Development ToolsSoftware

GW-Basic

GW-Basic is developed by the Microsoft company in the 1980s. It is basically developed in assembly language which is a low-level language. It is particularly designed for IBM PC and resembles the IBM BASICA language. However, its uniqueness lies in the fact that it is self-contained, executable, and does not require the ROM.

GW-Basic – Review

GW-BASIC is very suitable to program or code simple games, virtual business applications, and other similar developments. Its inclusion in the majority of the MS-DOS made it a reasonably affordable source for many ambitious programmers to learn basic computer programming. You can read the detailed documentation from the other sources. You may like to download MASM.

GW-Basic – Features

Modes

Once you have loaded and initialized on your computers, an Ok prompt is displayed on the screens which indicates that GW-BASIC is now at the command level and is ready for your commands. From this point, you can use one of the two modes of it i-e direct and indirect mode.

Direct Mode

Direct Mode executes the commands and statements as they are entered. It is able to display the logical operations and arithmetical results immediately and can also store them to be used later. Direct mode is good for debugging and for calculation so users can quickly compute figures without requiring a complete program.

Indirect Mode

Indirect mode instructions are lost once they are executed. Indirect Mode is utilized mainly to enter programs and in this mode Program lines always follow the line numbers and these program lines are stored in memory and are executed when the command RUN is entered.

GW-BASIC functions, statements, variables, and commands:

GW-BASIC programming is done with elements including keywords, statements, commands, variables, and functions.

Keywords

Keywords contain some special keywords that perform some actions on call. Such as GOTO, PRINT, and RETURN e.t.c; It has a particular significance for the Interpreter, and they are interpreted as a part of commands and statements.

Commands and Statements

Commands and statements, both are instructions that can be executed. The difference between both entities is that commands usually are executed in direct mode or on command level. They are generally used for program maintenance including loading, editing, or saving. On the other hand, a statement like GOTO, ON ERROR is a group of keywords generally used in program lines as the program’s part.

Functions

In functions, we have multiple types of functions. another part of GW-BASIC is Functions i-e numeric functions or string functions. Numeric Functions are mathematical calculations. While String Functions are strings based. For example, if the function of TIME$ and DATE$ is entered then the output is time and date that is known by the system. Variables are particular groups of alphabets and numeric that are assigned with values and provide information when they are executed.

Security

GW-BASIC makes some choices by default while keeping the basic security aspects in mind. However, while applying security measures, GW-BASIC avoids sandboxing its functions and programs in any notable way. In nutshell, GW-BASIC and programs developed with it have almost complete access to the host computer therefore, users should treat them by keeping in mind that relevant and appropriate cautions are necessary. For instance, users are recommended to not do run a program from the internet without first inspecting the source completely.

Easy learning

Microsoft’s GW-BASIC is very easy to learn and simple programming language because it has understandable mathematical notions and statements which are very similar to that of the normal English language. Despite its simplicity, users can write simple and complex types of programs for their computers With GW-BASIC. Not only programming, but it is also possible to modify the already developed GW-BASIC software.

Example 1: Basic Addition Program

Question: Create a GW-BASIC program to add two numbers.

10 INPUT "Enter first number: ", A
20 INPUT "Enter second number: ", B
30 SUM = A + B
40 PRINT "The sum is: "; SUM

Explanation: This program takes two numbers as input and stores them in variables A and B. It then calculates the sum of these numbers and prints the result.

Example 2: Calculating Area of a Circle

Question: Write a GW-BASIC program to calculate the area of a circle given its radius.

10 INPUT "Enter radius: ", R
20 AREA = 3.14 * R * R
30 PRINT "The area of the circle is: "; AREA

Explanation: The program calculates the area of a circle by using the formula \(\pi r^2\) (where \(\pi\) is approximated as 3.14). The radius \(r\) is taken as input from the user.

Example 3: Generating a Multiplication Table

Question: Create a GW-BASIC program to generate a multiplication table for a given number.

10 INPUT "Enter a number: ", N
20 FOR I = 1 TO 10
30 PRINT N; " * "; I; " = "; N * I
40 NEXT I

Explanation: This program takes a number and generates its multiplication table up to 10. It uses a FOR loop to iterate through the numbers 1 to 10 and prints each line of the table.

Example 4: Even or Odd Number Checker

Question: Write a GW-BASIC program to check if a number is even or odd.

10 INPUT "Enter a number: ", NUM
20 IF NUM MOD 2 = 0 THEN PRINT NUM; " is even"
30 IF NUM MOD 2 <> 0 THEN PRINT NUM; " is odd"

Explanation: The program checks whether a number is even or odd using the MOD operator, which returns the remainder of a division. If the remainder is 0, the number is even; otherwise, it’s odd.

Example 5: Finding the Largest Number

Question: Develop a GW-BASIC program to find the largest number among three given numbers.

10 INPUT "Enter first number: ", A
20 INPUT "Enter second number: ", B
30 INPUT "Enter third number: ", C
40 IF A > B AND A > C THEN PRINT "The largest number is "; A
50 IF B > A AND B > C THEN PRINT "The largest number is "; B
60 IF C > A AND C > B THEN PRINT "The largest number is "; C

Explanation: This program takes three numbers as input and compares them using IF statements. It then prints the largest of the three numbers.

 

GW-Basic – Technical Details

Title: GW-Basic
Added OnJanuary 14, 2022 5:15 am
Updated OnOctober 14, 2023 8:35 pm
Version: 3.23
Category: Photo Editors
License Type: Freeware
Operating System: Windows 90,XP,Vista,7,8,8.1, & 10.
Developers:GW-Basic
File Name: gwbasic.zip
File Size: 1.4 MB, 1.4 MB

GWBasic Free Download



Related Articles

7 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button