10 REM Sample BASIC Program - Counts To Ten 20 REM 30 REM Copyright 2005 Andrew Eichstaedt 40 REM Eichstaedt Development Group 50 REM http://www.andrew-eichstaedt.com 60 REM 70 PRINT "Hello! I am a sample BASIC program" 80 PRINT "that counts to ten." 90 PRINT 100 FOR I=1 TO 10 110 PRINT I 120 NEXT I 130 PRINT 140 PRINT "Thanks for running me." 150 END
$large
$regfile
=
"89c51cc.DAT"
$crystal =
24000000
Declare Sub Readkeys()
Dim I As Bit
Dim Tmpvar
As Byte
Dim Opv1 As Bit
Dim Opv2 As Bit
Dim Opv3 As Bit
Dim Opv4 As Bit
Dim Opv5 As Bit
Dim Opv6 As Bit
Dim Opv7 As Bit
Dim Opv8 As Bit
Dim Opv9 As Bit
Dim Opv10 As Bit
Dim Opv11 As Bit
Dim Opv12 As Bit
Dim Opv13 As Bit
Dim Opv14 As Bit
Dim Opv15 As Bit
Dim Opv16 As Bit
Sigstd
Alias P0.0
Sigd
Alias P0.1
Sigc
Alias P0.2
Sigb
Alias P0.3
Siga
Alias P0.4
O1 Alias P1.0
O2 Alias P1.1
O3 Alias P1.2
O4 Alias P1.3
O5 Alias P1.4
O6 Alias P1.5
O7 Alias P1.6
O8 Alias P1.7
O9 Alias P3.0
O10 Alias P3.1
O11 Alias P3.2
O12 Alias P3.3
O13 Alias P3.4
O14 Alias P3.5
O15 Alias P3.6
O16 Alias P3.7
Opv1 =
0
Opv2 =
0
Opv3 =
0
Opv4 =
0
Opv5 =
0
Opv6 =
0
Opv7 =
0
Opv8 =
0
Opv9 =
0
Opv10 =
0
Opv11 =
0
Opv12 =
0
Opv13 =
0
Opv14 =
0
Opv15 =
0
Opv16 =
0
O1 =
0
O2 =
0
O3 =
0
O4 =
0
O5 =
0
O6 =
0
O7 =
0
O8 =
0
O9 =
0
O10 =
0
O11 =
0
O12 =
0
O13 =
0
O14 =
0
O15 =
0
O16 =
0
I =
0
Do
Call Readkeys()
Loop
Sub Readkeys()
Bitwait
Sigstd
, Set
If Sigstd
=
1then
Tmpvar
=
0
If Siga
=
1 Then
Tmpvar
=
1
End If
If Sigb
=
1 Then
Tmpvar
=
Tmpvar
+ 2
End If
If Sigc
=
1 Then
Tmpvar
=
Tmpvar
+ 4
End If
If Sigd
=
1 Then
Tmpvar
=
Tmpvar
+ 8
End If
If Tmpvar
=
0 Then
Opv1 =
Not Opv1
O1 =
Opv1
Elseif
Tmpvar
=
1 Then
Opv2 =
Not Opv2
O2 =
Opv2
Elseif
Tmpvar
=
2 Then
Opv3 =
Not Opv3
O3 =
Opv3
Elseif
Tmpvar
=
3 Then
Opv4 =
Not Opv4
O4 =
Opv4
Elseif
Tmpvar
=
4 Then
Opv5 =
Not Opv5
O5 =
Opv5
Elseif
Tmpvar
=
5 Then
Opv6 =
Not Opv6
O6 =
Opv6
Elseif
Tmpvar
=
6 Then
Opv7 =
Not Opv7
O7 =
Opv7
Elseif
Tmpvar
=
7 Then
Opv8 =
Not Opv8
O8 =
Opv8
Elseif
Tmpvar
=
8 Then
Opv9 =
Not Opv9
O9 =
Opv9
Elseif
Tmpvar
=
9 Then
Opv10 =
Not Opv10
O10 =
Opv10
Elseif
Tmpvar
=
10 Then
Opv11 =
Not Opv11
O11 =
Opv11
Elseif
Tmpvar
=
11 Then
Opv12 =
Not Opv12
O12 =
Opv12
Elseif
Tmpvar
=
12 Then
Opv13 =
Not Opv13
O13 =
Opv13
Elseif
Tmpvar
=
13 Then
Opv14 =
Not Opv14
O14 =
Opv14
Elseif
Tmpvar
=
14 Then
Opv15 =
Not Opv15
O15 =
Opv15
Elseif
Tmpvar
=
15 Then
Opv16 =
Not Opv16
O16 =
Opv16
End If
Bitwait
Sigstd
, Reset
Waitms
50
End If
End Sub
Using TurboC? kbhit and getch are your friends
IF THE QBASIC IDE/INTEGRATED DEVELOPEMENT ENVIRONMENT *IS* ALREADY OPEN Inside of QBASIC IDE/Integrated Development Environment...; you load in QBASIC programs as follows... 1. Use your mouse to click the QBASIC Menu option being seen top right... File > Open ...then, browse through the file list box to load your chosen program file. 2. Alternatively, you can also use keyboard short cut... [ALT]+[F], this opens up the file menu...then, press [O] ...does exactly the same as above IF THE QBASIC IDE/INTEGRATED DEVELOPMENT ENVIRONMENT IS *NOT* ALREADY OPEN 3. Another way is to open up a command line window prompt: (>)... Click [Start] button ...then, type: Command .../or, type: Cmd ...at least, one of the above should work... ...and, run the QBASIC program from there... by typing in after the command line prompt: (>)... c:\> cd, means, change directory folder... cd C:\pathToQbasic For example the file path name to where my version of QBASIC is stored here... c:\basic\qb64 So, I would first change to this folder directory by typing in after the prompt: (>)... c:\>cd c:\basic\qb64 ...this changes my command line prompt: (>) to say... c:\basic\qb64> Inside of the [qb64] folder directory, I wrote a very simple program called: hw.bas ...which contains the following single line of code... PRINT "Hello, world!" I can launch both the QBASIC program: [qb64.exe]/and, at the same time load in my chosen program file: [hw.bas], by typing after the command line prompt: (>)... C:\Basic\qb64>qb64 hw.bas ...the QBASIC program instantly loads: [qb64.exe]/with the program file [hw.bas] already being displayed inside of the Editor Screen. Next, I only need to press function key [F5] to RUN/make that program file execute... QBASIC Output Screen... Hello, world! Press any key to continue...
10 cls 11 c = 0 20 for n =1 to 10 30 input"enter no.";a 40 c=c+a 50 next n 60 print c
There is no shortcut key of input in qbasic
The different types of operators in QBASIC are:Arithmetic OperatorsRelational OperatorsLogical Operators
how can we convert algebraic expression into QBASIC a square + b square i = pTR/100 2xy mx+c a=r square a+b
Using TurboC? kbhit and getch are your friends
the extensions of qbasic are that, there are only 80 pixels to write in the qbasic
qbasic is important because its technology
IF THE QBASIC IDE/INTEGRATED DEVELOPEMENT ENVIRONMENT *IS* ALREADY OPEN Inside of QBASIC IDE/Integrated Development Environment...; you load in QBASIC programs as follows... 1. Use your mouse to click the QBASIC Menu option being seen top right... File > Open ...then, browse through the file list box to load your chosen program file. 2. Alternatively, you can also use keyboard short cut... [ALT]+[F], this opens up the file menu...then, press [O] ...does exactly the same as above IF THE QBASIC IDE/INTEGRATED DEVELOPMENT ENVIRONMENT IS *NOT* ALREADY OPEN 3. Another way is to open up a command line window prompt: (>)... Click [Start] button ...then, type: Command .../or, type: Cmd ...at least, one of the above should work... ...and, run the QBASIC program from there... by typing in after the command line prompt: (>)... c:\> cd, means, change directory folder... cd C:\pathToQbasic For example the file path name to where my version of QBASIC is stored here... c:\basic\qb64 So, I would first change to this folder directory by typing in after the prompt: (>)... c:\>cd c:\basic\qb64 ...this changes my command line prompt: (>) to say... c:\basic\qb64> Inside of the [qb64] folder directory, I wrote a very simple program called: hw.bas ...which contains the following single line of code... PRINT "Hello, world!" I can launch both the QBASIC program: [qb64.exe]/and, at the same time load in my chosen program file: [hw.bas], by typing after the command line prompt: (>)... C:\Basic\qb64>qb64 hw.bas ...the QBASIC program instantly loads: [qb64.exe]/with the program file [hw.bas] already being displayed inside of the Editor Screen. Next, I only need to press function key [F5] to RUN/make that program file execute... QBASIC Output Screen... Hello, world! Press any key to continue...
10 cls 11 c = 0 20 for n =1 to 10 30 input"enter no.";a 40 c=c+a 50 next n 60 print c
There is no shortcut key of input in qbasic
The different types of operators in QBASIC are:Arithmetic OperatorsRelational OperatorsLogical Operators
Difference between QBASIC and GWBASIC?
CLS INPUT "Enter degrees in Celsius:";c INPUT "Enter degrees in Fahrenheit:";f a=(c*1.8)+32 b=5/9(f-32) PRINT c;"degree Celsius=" a;"degree Fahrenheit" PRINT f;"degree Fahrenheit=" b;"degree Celsius" end
Qbasic and Quickbasic are not the same! Qbasic was a free interpreter that Microsoft included with MS-DOS. Although Quickbasic uses similar syntax as quickbasic it allows programs to be compiled.
microsoft