Knowledge

Locomotive BASIC

Source 📝

340: 126: 288: 280: 296: 304:
system and palette handling was awkward. A table giving the numeric codes for the 27 system colors was printed over the built-in 3" disk drive casing on the 664 and later machines. Simple as it was, it did stand out however among other BASICs of the time by offering a timer-based software interrupt mechanism using the EVERY or AFTER commands; this offered a timed repeating or one-off call respectively to the BASIC line number of the user's choice.
348:
address(es) as parameter to the commands LOAD or SAVE would allow easy loading of raw uncompressed 16 KB screen pictures. CALLing another address gave a forced system reset (call 0), the famous "Press Any Key" (call &bb18) or for eliminating flicker in animation by allowing you to synchronize with the monitor's raster scan via "sync frame-flyback" (call &bd19); this was given its own dedicated command in Basic 1.1 - FRAME. With
22: 366: 331:
Disk, tape, and file management were managed by BASIC itself, and were usually good enough for simple file management, with commands such as GET, PUT, ERASE, SAVE, MERGE, RUN, CAT, LOAD etc. In fact, during those years, the BASIC supplied as standard with most low-cost home computers also acted as a
434:
in order to access the full sound and graphics capabilities of their system. MSX, Sinclair Spectrum and some others offered a similar, more or less complete command set for their sound and graphics capabilities. The only things going clearly beyond BASIC capabilities were the overscan modes used in
303:
It was a rather simple but powerful BASIC implementation by the standards of the day, featuring dedicated commands for handling graphics (such as DRAW, PLOT, INK, and PAPER in all versions; plus FILL in v1.1), even allowing the creation of multiple screens, windows, and the like, although the color
323:
computers, but none of those had such a complete built-in SOUND command. Many things, from selecting a particular channel or a combination of channels, setting envelopes, volume, pitch, noise, and so on could be done with a single SOUND command, with up to 7 parameters. Granted, especially complex
347:
Also available were some special commands for memory allocation and handling, like MEMORY and a parametric LOAD command, allowing, for example, to load a file containing "raw" picture data into video memory, causing it to be displayed, with a couple of BASIC instructions. Adding the right memory
324:
and/or low-level techniques could not be done with BASIC due to their requiring more precise or direct access to the hardware, e.g. especially complex music from trackers (including simulated chords using arpeggios, etc.), the playback of digitally sampled sounds as in the game
430:), which had no dedicated commands for graphics or sound, Locomotive BASIC allowed doing pretty much anything that was within the standard capabilities of the machine. This was not unimportant, as some other machines of the era required programmers to use 442:
or Commodore 64 BASIC, which had various keyboard command shortcuts or specialized keys for choosing symbols or colors, Locomotive BASIC keywords were typed in full and the interpreter
243:
There are two versions of Locomotive BASIC: 1.0 which only came with the CPC model 464, and 1.1 which shipped with all other versions. BASIC 1.1 was also shipped with the
307:
Also, when compared to other home computers of the time, the Amstrad via Locomotive BASIC granted a relatively high level of control over the CPC sound chip, an
217: 1339: 1612: 877: 263:
Z80 addon for the BBC Micro. It is reported to have taken around 12 weeks to enhance the existing code, and was "very influenced" by
86: 58: 1226: 65: 409: 105: 39: 391: 72: 1089: 557: 1443: 1438: 1221: 450:
them. However, there were abbreviations like "?" for "PRINT" and a few shortcuts. Programs could be saved onto
376: 43: 1294: 1204: 837: 515: 54: 989: 1607: 1149: 964: 762: 756: 480: 1094: 999: 201: 1486: 1099: 969: 535: 767: 510: 451: 387: 32: 447: 1536: 1320: 939: 571: 339: 79: 1423: 1266: 1233: 796: 605: 1602: 1491: 1355: 1307: 1246: 1160: 1064: 951: 669: 664: 659: 383: 8: 1571: 1461: 1335: 679: 612: 550: 283:
A program in Locomotive BASIC which draws a world map in Mode 1 (320x200px and 4 colours)
205: 435:
games and demos, 27-color graphics modes, digital sound playback, and smooth scrolling.
244: 752: 311:
with 3 melodic channels and 1 noise channel. The same chip was also used on late-model
1448: 1284: 1084: 920: 635: 622: 431: 268: 229: 1276: 910: 720: 526: 520: 333: 213: 163: 151: 1481: 1471: 1413: 1271: 1215: 894: 651: 595: 427: 260: 1576: 1556: 1428: 1173: 1029: 915: 806: 748: 543: 439: 125: 287: 1596: 1581: 1466: 1369: 994: 715: 702: 692: 601: 349: 279: 256: 225: 181: 1496: 1408: 1298: 1009: 925: 782: 735: 530: 485: 423: 267:, though adding additional functions to do things that would have required 352:, CALL provided an interface to assembly language programming from BASIC. 295: 1476: 1418: 1315: 1256: 1183: 1049: 1039: 984: 842: 827: 801: 641: 455: 312: 237: 209: 1566: 1561: 1546: 1193: 1109: 1044: 1019: 979: 959: 882: 862: 822: 791: 772: 710: 1531: 1511: 1501: 1456: 1433: 1384: 1373: 1261: 1074: 1054: 1034: 1024: 857: 587: 565: 308: 264: 186: 394:. Statements consisting only of original research should be removed. 291:
Printing colour bars on the screen in Mode 0 (16 colours) with BASIC
21: 1521: 1516: 1506: 1325: 1209: 1104: 1079: 1004: 832: 743: 630: 316: 255:
Development was based on existing work recently undertaken writing
1551: 1178: 1134: 1119: 1014: 902: 725: 443: 325: 1541: 1526: 1379: 1330: 1188: 1168: 1129: 1124: 974: 872: 867: 852: 847: 221: 156: 567: 459: 1345: 1114: 233: 481:"You're NOT fired: The story of Amstrad's amazing CPC 464" 1365: 472: 320: 247:
series machines, as part of the included game cartridge.
343:
Loading a picture from floppy disk in Locomotive BASIC
46:. Unsourced material may be challenged and removed. 1594: 551: 478: 299:Amstrad CPC colour palette with ink numbers 558: 544: 410:Learn how and when to remove this message 106:Learn how and when to remove this message 338: 294: 286: 278: 224:and 1640. It was the main descendant of 1595: 355: 539: 516:Command reference with code examples 359: 220:as a GEM application on the Amstrad 44:adding citations to reliable sources 15: 13: 14: 1624: 1613:BASIC programming language family 504: 479:Smith, Tony (12 February 2014). 364: 200:is a proprietary dialect of the 124: 20: 31:needs additional citations for 250: 1: 465: 7: 763:Data General Extended BASIC 458:and retrieved as binary or 390:the claims made and adding 274: 138:; 40 years ago 10: 1629: 511:Locomotive BASIC reference 212:(where it was built-in on 202:BASIC programming language 1487:Disk Extended Color BASIC 1401: 1354: 1306: 1293: 1245: 1159: 1147: 1100:Open Programming Language 1063: 950: 938: 893: 815: 781: 734: 701: 678: 650: 621: 586: 579: 177: 172: 162: 150: 132: 123: 1385:WinFBE, Visual FB Editor 768:Southampton BASIC System 527:Additional code examples 328:for example, and so on. 1537:MS BASIC for Macintosh 1321:Visual Basic (classic) 631:TI-BASIC (calculators) 570:programming language ( 344: 300: 292: 284: 1424:Atari Microsoft BASIC 1267:Microsoft Small Basic 1234:Embedded Visual Basic 797:VSI BASIC for OpenVMS 342: 298: 290: 282: 1492:Extended Color BASIC 665:Rocky Mountain BASIC 660:HP Time-Shared BASIC 332:more or less simple 40:improve this article 1572:TI BASIC (TI 99/4A) 1462:Benton Harbor BASIC 680:Locomotive Software 426:'s built in BASIC ( 356:Contemporary rivals 206:Locomotive Software 133:First appeared 120: 1608:BASIC interpreters 375:possibly contains 345: 301: 293: 285: 236:supplied with the 218:Locomotive BASIC-2 118: 55:"Locomotive BASIC" 1590: 1589: 1450:BASIC Programming 1397: 1396: 1393: 1392: 1336:Visual Basic .NET 1143: 1142: 934: 933: 921:Super Expander 64 636:TI Extended BASIC 623:Texas Instruments 521:Command reference 446:, recognized and 420: 419: 412: 377:original research 315:, as well as the 269:assembly language 195: 194: 116: 115: 108: 90: 1620: 1304: 1303: 1277:OpenOffice Basic 1157: 1156: 948: 947: 886: 721:North Star BASIC 688:Locomotive BASIC 584: 583: 566:Dialects of the 560: 553: 546: 537: 536: 498: 497: 495: 493: 476: 452:Compact Cassette 415: 408: 404: 401: 395: 392:inline citations 368: 367: 360: 334:operating system 245:Amstrad CPC Plus 216:) and the later 198:Locomotive Basic 146: 144: 139: 128: 121: 119:Locomotive BASIC 117: 111: 104: 100: 97: 91: 89: 48: 24: 16: 1628: 1627: 1623: 1622: 1621: 1619: 1618: 1617: 1593: 1592: 1591: 1586: 1482:Dartmouth BASIC 1472:Commodore BASIC 1414:Applesoft BASIC 1389: 1357: 1350: 1297: 1289: 1248: 1241: 1216:Microsoft Excel 1152: 1139: 1066: 1059: 943: 930: 889: 880: 811: 777: 730: 697: 674: 652:Hewlett-Packard 646: 617: 600:TRS-80 BASICs ( 596:Microsoft BASIC 575: 564: 507: 502: 501: 491: 489: 477: 473: 468: 428:Commodore BASIC 416: 405: 399: 396: 381: 369: 365: 358: 277: 261:Acorn Computers 253: 191: 142: 140: 137: 112: 101: 95: 92: 49: 47: 37: 25: 12: 11: 5: 1626: 1616: 1615: 1610: 1605: 1588: 1587: 1585: 1584: 1579: 1577:Turbo-BASIC XL 1574: 1569: 1564: 1559: 1557:Sinclair BASIC 1554: 1549: 1544: 1539: 1534: 1529: 1524: 1519: 1514: 1509: 1504: 1499: 1494: 1489: 1484: 1479: 1474: 1469: 1464: 1459: 1454: 1446: 1441: 1436: 1431: 1429:Atari ST BASIC 1426: 1421: 1416: 1411: 1405: 1403: 1399: 1398: 1395: 1394: 1391: 1390: 1388: 1387: 1382: 1377: 1362: 1360: 1352: 1351: 1349: 1348: 1343: 1333: 1328: 1323: 1318: 1312: 1310: 1301: 1291: 1290: 1288: 1287: 1282: 1279: 1274: 1269: 1264: 1259: 1253: 1251: 1243: 1242: 1240: 1239: 1236: 1231: 1230: 1229: 1224: 1212: 1207: 1202: 1199: 1196: 1191: 1186: 1181: 1176: 1174:Chipmunk Basic 1171: 1165: 1163: 1154: 1145: 1144: 1141: 1140: 1138: 1137: 1132: 1127: 1122: 1117: 1112: 1107: 1102: 1097: 1092: 1087: 1082: 1077: 1071: 1069: 1061: 1060: 1058: 1057: 1052: 1047: 1042: 1037: 1032: 1027: 1022: 1017: 1012: 1007: 1002: 997: 992: 987: 982: 977: 972: 967: 962: 956: 954: 945: 936: 935: 932: 931: 929: 928: 923: 918: 916:Super Expander 913: 908: 907:Graphics BASIC 905: 899: 897: 891: 890: 888: 887: 875: 870: 865: 860: 855: 850: 845: 840: 835: 830: 825: 819: 817: 813: 812: 810: 809: 807:CALL/360:BASIC 804: 799: 794: 788: 786: 779: 778: 776: 775: 770: 765: 760: 749:Business Basic 746: 740: 738: 732: 731: 729: 728: 723: 718: 713: 707: 705: 703:Microcomputers 699: 698: 696: 695: 690: 684: 682: 676: 675: 673: 672: 667: 662: 656: 654: 648: 647: 645: 644: 639: 633: 627: 625: 619: 618: 616: 615: 609: 598: 592: 590: 581: 577: 576: 563: 562: 555: 548: 540: 534: 533: 524: 518: 513: 506: 505:External links 503: 500: 499: 470: 469: 467: 464: 440:Sinclair BASIC 418: 417: 372: 370: 363: 357: 354: 276: 273: 252: 249: 193: 192: 190: 189: 184: 178: 175: 174: 170: 169: 166: 160: 159: 154: 148: 147: 134: 130: 129: 114: 113: 28: 26: 19: 9: 6: 4: 3: 2: 1625: 1614: 1611: 1609: 1606: 1604: 1601: 1600: 1598: 1583: 1582:Vilnius BASIC 1580: 1578: 1575: 1573: 1570: 1568: 1565: 1563: 1560: 1558: 1555: 1553: 1550: 1548: 1545: 1543: 1540: 1538: 1535: 1533: 1530: 1528: 1525: 1523: 1520: 1518: 1515: 1513: 1510: 1508: 1505: 1503: 1500: 1498: 1495: 1493: 1490: 1488: 1485: 1483: 1480: 1478: 1475: 1473: 1470: 1468: 1467:Chinese BASIC 1465: 1463: 1460: 1458: 1455: 1453: 1451: 1447: 1445: 1442: 1440: 1437: 1435: 1432: 1430: 1427: 1425: 1422: 1420: 1417: 1415: 1412: 1410: 1407: 1406: 1404: 1400: 1386: 1383: 1381: 1378: 1375: 1371: 1370:Basic4android 1367: 1364: 1363: 1361: 1359: 1353: 1347: 1344: 1341: 1337: 1334: 1332: 1329: 1327: 1324: 1322: 1319: 1317: 1314: 1313: 1311: 1309: 1305: 1302: 1300: 1296: 1292: 1286: 1283: 1280: 1278: 1275: 1273: 1270: 1268: 1265: 1263: 1260: 1258: 1255: 1254: 1252: 1250: 1244: 1238:WinWrap Basic 1237: 1235: 1232: 1228: 1225: 1223: 1220: 1219: 1217: 1213: 1211: 1208: 1206: 1203: 1200: 1197: 1195: 1192: 1190: 1187: 1185: 1182: 1180: 1177: 1175: 1172: 1170: 1167: 1166: 1164: 1162: 1158: 1155: 1151: 1146: 1136: 1133: 1131: 1128: 1126: 1123: 1121: 1118: 1116: 1113: 1111: 1108: 1106: 1103: 1101: 1098: 1096: 1093: 1091: 1088: 1086: 1083: 1081: 1078: 1076: 1073: 1072: 1070: 1068: 1062: 1056: 1053: 1051: 1048: 1046: 1043: 1041: 1038: 1036: 1033: 1031: 1028: 1026: 1023: 1021: 1018: 1016: 1013: 1011: 1008: 1006: 1003: 1001: 998: 996: 995:Liberty BASIC 993: 991: 988: 986: 983: 981: 978: 976: 973: 971: 968: 966: 963: 961: 958: 957: 955: 953: 949: 946: 941: 937: 927: 924: 922: 919: 917: 914: 912: 911:Simons' BASIC 909: 906: 904: 901: 900: 898: 896: 892: 884: 879: 876: 874: 871: 869: 866: 864: 861: 859: 856: 854: 851: 849: 846: 844: 841: 839: 836: 834: 831: 829: 826: 824: 821: 820: 818: 814: 808: 805: 803: 800: 798: 795: 793: 790: 789: 787: 784: 780: 774: 771: 769: 766: 764: 761: 758: 754: 750: 747: 745: 742: 741: 739: 737: 736:Minicomputers 733: 727: 724: 722: 719: 717: 716:Integer BASIC 714: 712: 709: 708: 706: 704: 700: 694: 693:Mallard BASIC 691: 689: 686: 685: 683: 681: 677: 671: 668: 666: 663: 661: 658: 657: 655: 653: 649: 643: 640: 637: 634: 632: 629: 628: 626: 624: 620: 614: 610: 607: 603: 599: 597: 594: 593: 591: 589: 585: 582: 578: 573: 569: 561: 556: 554: 549: 547: 542: 541: 538: 532: 528: 525: 522: 519: 517: 514: 512: 509: 508: 488: 487: 482: 475: 471: 463: 461: 457: 453: 449: 445: 441: 436: 433: 429: 425: 414: 411: 403: 393: 389: 385: 379: 378: 373:This section 371: 362: 361: 353: 351: 350:PEEK and POKE 341: 337: 335: 329: 327: 322: 318: 314: 310: 305: 297: 289: 281: 272: 270: 266: 262: 258: 257:Mallard BASIC 248: 246: 241: 239: 235: 231: 227: 226:Mallard BASIC 223: 219: 215: 211: 207: 203: 199: 188: 185: 183: 182:Mallard BASIC 180: 179: 176: 173:Influenced by 171: 167: 165: 161: 158: 155: 153: 149: 135: 131: 127: 122: 110: 107: 99: 96:December 2009 88: 85: 81: 78: 74: 71: 67: 64: 60: 57: –  56: 52: 51:Find sources: 45: 41: 35: 34: 29:This article 27: 23: 18: 17: 1497:Family BASIC 1452:(Atari 2600) 1449: 1409:Altair BASIC 1010:Mobile BASIC 926:YS MegaBasic 783:Time-sharing 757:Data General 687: 638:(aka XBasic) 606:Level II/III 531:Rosetta Code 523:(incomplete) 490:. Retrieved 486:The Register 484: 474: 437: 424:Commodore 64 421: 406: 397: 374: 346: 330: 313:ZX Spectrums 306: 302: 271:on the BBC. 254: 242: 197: 196: 102: 93: 83: 76: 69: 62: 50: 38:Please help 33:verification 30: 1603:Amstrad CPC 1477:Color BASIC 1419:Atari BASIC 1358:open source 1316:CA-Realizer 1308:Proprietary 1281:ScriptBasic 1249:open source 1184:LotusScript 1161:Proprietary 1095:Indic BASIC 1067:open source 1050:Turbo Basic 1040:Tiger-BASIC 985:FutureBASIC 952:Proprietary 881: [ 843:Casio BASIC 828:Astro BASIC 802:SUPER BASIC 642:TI-BASIC 83 492:17 February 456:floppy disk 422:Unlike the 251:Development 238:Amstrad PCW 230:interpreter 210:Amstrad CPC 204:written by 168:Proprietary 1597:Categories 1567:SuperBASIC 1562:STOS BASIC 1547:QuickBASIC 1272:Mono-Basic 1194:PowerBASIC 1153:extensions 1110:SmallBASIC 1045:True BASIC 1030:SmileBASIC 1020:PowerBASIC 980:Beta BASIC 965:AMOS BASIC 960:AmigaBASIC 863:Tiny BASIC 823:AlphaBasic 792:BASIC-PLUS 773:Wang BASIC 711:Atom BASIC 466:References 384:improve it 66:newspapers 1532:MSX BASIC 1512:IBM BASIC 1502:GFA BASIC 1457:BBC BASIC 1374:Basic4ppc 1299:designers 1262:FreeBASIC 1214:VB 5 for 1201:Run BASIC 1085:DarkBASIC 1075:Basic-256 1055:WordBASIC 1035:ThinBasic 1025:PureBasic 940:Procedure 895:Extenders 858:SDS BASIC 785:computers 613:BASIC 1.0 588:Microsoft 448:tokenised 432:assembler 400:July 2019 388:verifying 309:AY-3-8912 265:BBC BASIC 187:BBC BASIC 1522:MacBASIC 1517:JR-BASIC 1507:GW-BASIC 1444:BASIC XL 1439:BASIC XE 1434:BASIC A+ 1356:Free and 1326:NS Basic 1257:BlitzMax 1247:Free and 1210:VBScript 1198:ProvideX 1105:SdlBasic 1090:Euphoria 1080:Basic4GL 1065:Free and 1005:MapBasic 944:oriented 833:BASICODE 744:BASIC-11 670:HP Basic 611:Thomson 317:Atari ST 275:Features 1552:S-BASIC 1402:Defunct 1340:Mercury 1179:GLBasic 1135:Yabasic 1120:wxBasic 1015:OWBasic 903:BASIC 8 878:ETBASIC 726:SCELBAL 602:Level I 580:Classic 462:files. 438:Unlike 382:Please 326:RoboCop 208:on the 164:License 141: ( 80:scholar 1542:QBasic 1527:MBASIC 1380:Gambas 1331:RapidQ 1285:Roslyn 1189:Morfik 1169:AutoIt 1150:object 1130:Xblite 1125:XBasic 975:BasicX 873:ZBasic 868:UBASIC 853:PBASIC 848:CBASIC 444:parsed 228:, the 222:PC1512 157:AMSDOS 82:  75:  68:  61:  53:  1148:With 990:GRASS 885:] 816:Other 568:BASIC 460:ASCII 87:JSTOR 73:books 1346:Xojo 1227:VSTA 1222:VSTO 1218:5.0 1115:QB64 970:ASIC 572:list 494:2014 319:and 259:for 234:CP/M 232:for 143:1984 136:1984 59:news 1366:B4X 1295:RAD 1205:VBA 1000:LSE 838:BAL 753:B32 529:at 454:or 386:by 321:MSX 214:ROM 42:by 1599:: 1372:, 883:zh 755:, 604:, 483:. 336:. 240:. 152:OS 1376:) 1368:( 1342:) 1338:( 942:- 759:) 751:( 608:) 574:) 559:e 552:t 545:v 496:. 413:) 407:( 402:) 398:( 380:. 145:) 109:) 103:( 98:) 94:( 84:· 77:· 70:· 63:· 36:.

Index


verification
improve this article
adding citations to reliable sources
"Locomotive BASIC"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message

OS
AMSDOS
License
Mallard BASIC
BBC BASIC
BASIC programming language
Locomotive Software
Amstrad CPC
ROM
Locomotive BASIC-2
PC1512
Mallard BASIC
interpreter
CP/M
Amstrad PCW
Amstrad CPC Plus
Mallard BASIC
Acorn Computers

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.