SlideShare a Scribd company logo
Simplified Instructional
Computer
By: Kirby Paul E. Fabro
The Simplified Instructional Computer
• (also abbreviated SIC) is a
hypothetical computer system introduced in System
Software: An Introduction to Systems Programming, by
Leland Beck. Due to the fact that most modern
microprocessors include subtle, complex functions for
the purposes of efficiency, it can be difficult to learn
systems programming using a real-world system. The
Simplified Instructional Computer solves this by
abstracting away these complex behaviors in favor of
an architecture that is clear and accessible for those
wanting to learn systems programming.
SIC Architecture
• The SIC machine has basic addressing, storing most memory addresses hexadecimal integer format. Similar to most modern
computing systems, the SIC architecture stores all data in binary and uses the two's complement to represent negative
values at the machine level. Memory storage in SIC consists of 8-bit bytes, and all memory addresses in SIC are byte
addresses. Any three consecutive bytes form a 24-bit 'word' value, addressed by the location of the lowest numbered byte in
the word value. Numeric values are stored as word values, and character values use the 8-bit ASCII system. The SIC machine
does not support floating-point hardware and have at most 32,768 bytes of memory. There is also a more complicated
machine built on top of SIC called the Simplified Instruction Computer with Extra Equipment (SIC/XE). The XE expansion of
SIC adds a 48-bit floating point data type, an additional memory addressing mode, and extra memory (1 megabyte instead
of 32,768 bytes) to the original machine. All SIC assembly code is upwards compatible with SIC/XE.
• SIC machines have several registers, each 24 bits long and having both a numeric and character representation:
• A (0): Used for basic arithmetic operations; known as the accumulator register.
• X (1): Stores and calculates addresses; known as the index register.
• L (2): Used for jumping to specific memory addresses and storing return addresses; known as the linkage register.
• PC (8): Contains the address of the next instruction to execute; known as the program counter register.
• SW (9): Contains a variety of information, such as carry or overflow flags; known as the status word register.
• In addition to the standard SIC registers, there are also four additional general-purpose registers specific to the SIC/XE
machine:
• B (3): Used for addressing; know as the base register.
• S (4): No special use, general purpose register.
• T (5): No special use, general purpose register.
• F (6): Floating point accumulator register (This register is 48-bits instead of 24).
• These five/nine registers allow the SIC or SIC/XE machine to perform most simple tasks in a customized assembly language.
In the System Software book, this is used with a theoretical series of operation codes to aid in the understanding of
assemblers and linker-loaders required for the execution of assembly language code.
Addressing Modes for SIC and SIC/XE
• The Simplified Instruction Computer has three instruction formats, and the Extra Equipment
add-on includes a fourth. The instruction formats provide a model for memory and data
management. Each format has a different representation in memory:
• Format 1: Consists of 8 bits of allocated memory to store instructions.
• Format 2: Consists of 16 bits of allocated memory to store 8 bits of instructions and two 4-
bits segments to store operands.
• Format 3: Consists of 6 bits to store an instruction, 6 bits of flag values, and 12 bits of
displacement.
• Format 4: Only valid on SIC/XE machines, consists of the same elements as format 3, but
instead of a 12-bit displacement, stores a 20-bit address.
• Both format 3 and format 4 have six-bit flag values in them, consisting of the following flag
bits:
• n: Indirect addressing flag
• i: Immediate addressing flag
• x: Indexed addressing flag
• b: Base address-relative flag
• p: Program counter-relative flag
• e: Format 4 instruction flag
SIC Assembly Syntax
• SIC uses a special assembly language with its own
operation codes that hold the hex values needed to
assemble and execute programs. A sample program is
provided below to get an idea of what a SIC program might
look like. In the code below, there are three columns. The
first column represents a forwarded symbol that will store
its location in memory. The second column denotes either a
SIC instruction (opcode) or a constant value (BYTE or
WORD). The third column takes the symbol value obtained
by going through the first column and uses it to run the
operation specified in the second column. This process
creates an object code, and all the object codes are put into
an object file to be ran by the SIC machine.
• COPY START 1000
FIRST STL RETADR
CLOOP JSUB RDREC
LDA LENGTH
COMP ZERO
JEQ ENDFIL
JSUB WRREC
J CLOOP
ENDFIL LDA EOF
STA BUFFER
LDA THREE
STA LENGTH
JSUB WRREC
LDL RETADR
RSUB
EOF BYTE C'EOF'
THREE WORD 3
ZERO WORD 0
RETADR RESW 1
LENGTH RESW 1
BUFFER RESB 4096
.
. SUBROUTINE TO READ RECORD INTO BUFFER
.
• RDREC LDX ZERO
LDA ZERO
RLOOP TD INPUT
JEQ RLOOP
RD INPUT
COMP ZERO
JEQ EXIT
STCH BUFFER,X
TIX MAXLEN
JLT RLOOP
EXIT STX LENGTH
RSUB
INPUT BYTE X'F1'
MAXLEN WORD 4096
.
. SUBROUTINE TO WRITE RECORD FROM BUFFER
.
• WRREC LDX ZERO
WLOOP TD OUTPUT
JEQ WLOOP
LDCH BUFFER,X
WD OUTPUT
TIX LENGTH
JLT WLOOP
RSUB
OUTPUT BYTE X'06'
END FIRST
• If you were to assemble this program, you would get the object code
depicted below. The beginning of each line consists of a record type and
hex values for memory locations. For example, the top line is an 'H' record,
the first 6 hex digits signify its relative starting location, and the last 6 hex
digits represent the program's size. The lines throughout are similar, with
each 'T' record consisting of 6 hex digits to signify that line's starting
location, 2 hex digits to indicate the size (in bytes) of the line, and the
object codes that were created during the assembly process.
• HCOPY 00100000107A
T0010001E1410334820390010362810303010154820613C100300102A0C
103900102D
T00101E150C10364820610810334C0000454F46000003000000
T0020391E041030001030E0205D30203FD8205D2810303020575490392C
205E38203F
T0020571C1010364C0000F1001000041030E02079302064509039DC2079
2C1036 T002073073820644C000006 E001000
Emulating the SIC System
• Since the SIC and SIC/XE machines are not real machines, the task
of actually constructing a SIC emulator is often part of coursework
in a systems programming class. The purpose of SIC is to teach
introductory-level systems programmers or collegiate students how
to write and assemble code below higher-level languages like C and
C++. With that being said, there are some sources of SIC-emulating
programs across the web, however infrequent they may be.
• An assembler and a simulator written by the author, Leland in
Pascal is available on his educational home page
at ftp://rohan.sdsu.edu/faculty/beck
• SIC/XE Simulator And Assembler downloadable
at https://sites.google.com/site/sarimohsultan/Projects/sic-xe-
simulator-and-assembler
• SIC Emulator, Assembler and some example programs written for
SIC downloadable at http://sicvm.sourceforge.net/home.php
Comparison of programming
languages
• is a common topic of discussion
among software engineers. Basic instructions
of severalprogramming languages are
compared here.
• Conventions of this article
• The bold is the literal code. The non-bold is
interpreted by the reader. Statements
in guillemets (« … ») are
optional. Tab ↹indicates a necessary indent
(with whitespace).
Type identifiers
• 8 bit (byte)16 bit (short integer)32 bit64 bit (long integer)Word sizeArbitrarily precise (bignum)SignedUnsignedSignedUnsignedSignedUnsignedSignedUnsignedSignedUnsignedAda[1]range
-2**7 .. 2**7 - 1[j]range 0 .. 2**8 - 1[j] ormod 2**8[k]range -2**15 .. 2**15 - 1[j]range 0 .. 2**16 - 1[j] ormod 2**16[k]range -2**31 .. 2**31 - 1[j]range 0 .. 2**32 - 1[j] ormod 2**32[k]range -
2**63 .. 2**63 - 1[j]mod 2**64[k]Integer[j]range 0 .. 2**Integer'Size - 1[j] ormod Integer'Size[k]N/AALGOL 68(variable-width)short short int[c]N/Ashort int[c]N/Aint[c]N/Along
int[c]N/Aint[c]N/Along long int [a][g]bytes & bitsC (C99fixed-width)int8_tuint8_tint16_tuint16_tint32_tuint32_tint64_tuint64_tintunsigned intN/AC++ (C++11fixed-width)C (C99variable-
width)signed charunsigned charshort[c]unsigned short[c]long[c]unsigned long[c]long long[c]unsigned long long[c]C++ (C++11variable-width)Objective-Csigned charunsigned
charshort[c]unsigned short[c]long[c]unsigned long[c]long long[c]unsigned long long[c]int
or
NSIntegerunsigned int
or
NSUIntegerC#sbytebyteshortushortintuintlongulongIntPtrUIntPtrSystem.Numerics.BigInteger
(.NET
4.0)JavabyteN/Achar[b]N/AN/AN/AN/Ajava.math.BigIntegerGoint8uint8 orbyteint16uint16int32uint32int64uint64intuintbig.IntSwiftInt8UInt8Int16UInt16Int32UInt32Int64UInt64IntUIntD
byteubyteshortushortintuintlongulongN/AN/ABigIntCommon
Lisp[2]bignumSchemeISLISP[3]bignumPascal(FPC)shortintbytesmallintwordlongintlongwordint64qwordintegercardinalN/AVisual BasicN/AByteIntegerN/ALongN/AN/AN/AN/AVisual Basic
.NETSByteShortUShortIntegerUIntegerLongULongSystem.Numerics.BigInteger
(.NET
4.0)FreeBasicByte orInteger<8>UByte orUInteger<8>Short orInteger<16>UShort orUInteger<16>Long orInteger<32>ULong orUInteger<32>LongInt orInteger<64>ULongInt orUInteger<64>
IntegerUIntegerN/APython 2.xN/AN/AN/AN/AintN/AlongPython 3.xN/AN/AN/AN/AN/AintS-LangN/AN/AN/AN/AN/AN/AFortranINTEGER(KIND = n)[f]N/AINTEGER(KIND =
n)[f]N/AINTEGER(KIND = n)[f]N/AINTEGER(KIND = n)[f]N/APHPN/AN/Aint [m]N/Aint [m]N/AN/A[e]Perl 5N/A[d]N/A[d]N/A[d]N/A[d]N/A[d]Math::BigIntPerl
6int8uint8int16uint16int32uint32int64uint64IntN/ARubyN/AN/AN/AN/AFixnumN/ABignumErlang[n]N/AN/AN/AN/Ainteger()N/Ainteger()[o]ScalaByteN/AShortChar[l]IntN/ALongN/AN/AN/
Ascala.math.BigIntSeed7N/AN/AN/AN/AN/AN/AintegerN/AN/AN/AbigIntegerSmalltalkN/AN/AN/AN/ASmallInteger[i]N/ALargeInteger[i]Windows
PowerShellN/AN/AN/AN/AN/AN/AOCamlN/AN/Aint32N/Aint64N/Aint
or
nativeintopen Big_int;;
big_intF#sbytebyteint16uint16int32 or intuint32uint64nativeintunativeintbigintStandard MLN/AWord8.wordN/AInt32.intWord32.wordInt64.intWord64.wordintwordLargeInt.int or
IntInf.intHaskell(GHC)«import Int»
Int8«import Word»
Word8«import Int»
Int16«import Word»
Word16«import Int»
Int32«import Word»
Word32«import Int»
Int64«import Word»
Word64Int«import Word»
WordIntegerEiffelINTEGER_8NATURAL_8INTEGER_16NATURAL_16INTEGER_32NATURAL_32INTEGER_64NATURAL_64INTEGERNATURALN/ACOBOL[h]BINARY-CHAR «SIGNED»BINARY-
CHAR UNSIGNEDBINARY-SHORT «SIGNED»BINARY-SHORT UNSIGNEDBINARY-LONG «SIGNED»BINARY-LONG UNSIGNEDBINARY-DOUBLE «SIGNED»BINARY-DOUBLE
UNSIGNEDN/AN/AN/AMathematicaN/AN/AN/AN/AN/AInteger
• ^a The standard constants int shorts and int lengths can be used to determine how
many 'short's and 'long's can be usefully prefixed to 'short int' and 'long int'. The
actually size of the 'short int', 'int' and 'long int' is available as constants short max
int, max int and long max int etc.
^b Commonly used for characters.
^c The ALGOL 68, C and C++ languages do not specify the exact width of the
integer types short, int, long, and (C99, C++11) long long, so they are
implementation-dependent. In C and C++ short, long, and long long types are
required to be at least 16, 32, and 64 bits wide, respectively, but can be more.
The int type is required to be at least as wide as short and at most as wide as long,
and is typically the width of the word size on the processor of the machine (i.e. on
a 32-bit machine it is often 32 bits wide; on 64-bit machines it is often 64 bits
wide). C99 and C++11[citation needed] also define the [u]intN_t exact-width types in
the stdint.h header. SeeC syntax#Integral types for more information.
^d Perl 5 does not have distinct types. Integers, floating point numbers, strings,
etc. are all considered "scalars".
^e PHP has two arbitrary-precision libraries. The BCMath library just uses strings as
datatype. The GMP library uses an internal "resource" type.
• ^f The value of "n" is provided by the SELECTED_INT_KIND[4] intrinsic
function.
^g ALGOL 68G's run time option --precision "number" can set precision
for long long ints to the required "number" significant digits.
The standard constants long long int widthand long long max int can be
used to determine actual precision.
^h COBOL allows the specification of a required precision and will
automatically select an available type capable of representing the
specified precision. "PIC S9999", for example, would required a signed
variable of four decimal digits precision. If specified as a binary field, this
would select a 16 bit signed type on most platforms.
^i Smalltalk automatically chooses an appropriate representation for
integral numbers. Typically, two representations are present, one for
integers fitting the native word size minus any tag bit (SmallInteger) and
one supporting arbitrary sized integers (LargeInteger). Arithmetic
operations support polymorphic arguments and return the result in the
most appropriate compact representation.
• ^j Ada range types are checked for boundary violations at run-time (as
well as at compile-time for static expressions). Run time boundary
violations raise a "constraint error" exception. Ranges are not restricted to
powers of two. Commonly predefined Integer subtypes are: Positive
(range 1 .. Integer'Last) and Natural (range 0 ..
Integer'Last).Short_Short_Integer (8 bit), Short_Integer (16 bit)
and Long_Integer (64 bit) are also commonly predefined, but not required
by the Ada standard. Run time checks can be disabled if performance is
more important than integrity checks.
^k Ada modulo types implement modulo arithmetic in all operations, i.e.
no range violations are possible. Modulos are not restricted to powers of
two.
^l Commonly used for characters like Java's char.
^m int in PHP has the same width as long type in C has on that system [c].
^n Erlang is dynamically typed. The type identifiers are usually used to
specify types of record fields and the argument and return types of
functions.[5]
^o When it exceeds 1 word.[6]
• Floating point[edit]
• Single precisionDouble precisionProcessor
dependentAda[1]FloatLong_FloatN/AALGOL
68real[a]long real[a]short real, long long real,
etc.[d]Cfloat[b]doublelong double[f]Objective-
CC++
(STL)C#floatN/AJavaGofloat32float64SwiftFloa
tDoubleDfloatdoublereal
• Common LispSchemeISLISPPascal (Free
Pascal)singledoublerealVisual
BasicSingleDoubleN/AVisual Basic
.NETXojoPythonN/AfloatJavaScriptNumber[7]N
/A
• S-LangFortranREAL(KIND =
n)[c]PHPfloatPerlPerl
6num32num64NumRubyN/AFloatN/AScalaFlo
atDoubleSeed7N/AfloatSmalltalkFloatDouble
• Windows
PowerShellOCamlN/AfloatN/AF#float32Standa
rd MLN/ArealHaskell
(GHC)FloatDoubleEiffelREAL_32REAL_64COBO
LFLOAT-BINARY-7[e]FLOAT-BINARY-34[e]FLOAT-
SHORT, FLOAT-LONG, FLOAT-
EXTENDEDMathematicaN/AN/AReal
BASIC
• BASIC (an acronym for Beginner's All-purpose Symbolic Instruction Code) is a
family of general-purpose, high-level programming languages whose design
philosophy emphasizes ease of use.
• In 1964, John G. Kemeny and Thomas E. Kurtz designed the original BASIC
language at Dartmouth College in New Hampshire. They wanted to enable
students in fields other than science and mathematics to use computers. At the
time, nearly all use of computers required writing custom software, which was
something only scientists and mathematicians tended to learn.
• Versions of BASIC became widespread on microcomputers in the mid-1970s and
1980s. Microcomputers usually shipped with BASIC, often in the
machine's firmware. Having an easy-to-learn language on these early personal
computers allowed small business owners, professionals, hobbyists, and
consultants to develop custom software on computers they could afford.
• BASIC remains popular in many dialects and in new languages influenced by BASIC,
such as Microsoft's Visual Basic. In 2006, 59% of developers for the .NET
Framework used Visual Basic .NET as their only programming language.
History
• Before the mid-1960s, computers were extremely expensive mainframe machines,
usually requiring a dedicated computer room and air-conditioning, used by large
organizations for scientific and commercial tasks. Users submitted jobs,
on punched cards or similar media, to computer operators, and usually collected
the output later. A simple batch processing arrangement ran only a single "job" at
a time, one after another. During the 1960s faster and more affordable computers,
still mainframes, became available, and time-sharing—a technique which allows
multiple users or processes to share use of the CPU and memory—was developed.
In such a system the operating system gives each of several processes time on the
CPU, then pauses it and switches to another; each process behaves as if it had full
use of the computer, although the time to complete its operation increases. Time-
sharing was initially used to allow several batched processes to execute
simultaneously.
• Time-sharing also allowed several independent users to interact with a computer,
working on terminals with keyboards and teletype printers, and later display
screens. Computers were fast enough to respond quickly to each user.
• The need to optimize interactive time-sharing, using command line
interpreters and programming languages, was an area of intense research during
the 1960s and 1970s.
Origin
• The original BASIC language was designed on May 1, 1964 by John Kemeny and Thomas
Kurtz[2] and implemented by a team of Dartmouth students under their direction.
The acronymBASIC comes from the name of an unpublished paper by Thomas Kurtz.[3] BASIC
was designed to allow students to write mainframe computer programs for the Dartmouth
Time-Sharing System. It was intended specifically for less technical users who did not have or
want the mathematical background previously expected. Being able to use a computer to
support teaching and research was quite novel at the time.
• The language was based on FORTRAN II, with some influences from ALGOL 60 and with
additions to make it suitable for timesharing. Initially, BASIC concentrated on supporting
straightforward mathematical work, with matrix arithmetic support from its initial
implementation as a batch language, and character string functionality being added by 1965.
• The designers of the language decided to make the compiler available free of charge so that
the language would become widespread. (In the 1960s software became a chargeable
commodity; until then it was provided without charge as a service with the very expensive
computers, usually available only to lease.) They also made it available to high schools in
theHanover area, and put a considerable amount of effort into promoting the language. In
the following years, as other dialects of BASIC appeared, Kemeny and Kurtz's original BASIC
dialect became known as Dartmouth BASIC.
Spread on minicomputers
• Knowledge of the relatively simple BASIC became widespread for a computer
language, and it was implemented by a number of manufacturers, becoming fairly
popular on newer minicomputers such as the DEC PDP series and the Data General
Nova. The BASIC language was also central to the HP Time-Shared BASIC system in
the late 1960s and early 1970s, where the language was implemented as
an interpreter. Also at this time it was ported into the Pick operating system where
a compiler renders it into bytecode, able to be interpreted by a virtual machine.
• During this period a number of simple computer games were written in BASIC,
most notably Mike Mayfield's Star Trek. A number of these were collected by DEC
employee David H. Ahl and published in a newsletter he compiled. He later
collected a number of these into book form, "101 BASIC Computer Games", which
was first published in 1973.[4][5] During the same period, Ahl was involved in the
creation of a small computer for education use, an early personal computer. When
management refused to support the concept, Ahl left DEC in 1974 to found the
seminal computer magazine,Creative Computing. The book remained popular, and
was re-published on several occasions.
Explosive growth: the home
computer era
• he 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.
• One of the first to appear was Tiny BASIC, a simple BASIC variant designed by
Dennis Allison at the urging of Bob Albrecht of the Homebrew Computer Club. He
had seen BASIC on minicomputers and felt it would be the perfect match for new
machines like the MITS Altair 8800. How to design and implement a stripped-down
version of an interpreter for the BASIC language was covered in articles by Allison
in the first three quarterly issues of thePeople's Computer Company newsletter
published in 1975 and implementations with source code published in Dr. Dobb's
Journal of Tiny BASIC Calisthenics & Orthodontia: Running Light Without Overbyte.
Versions were written by Li-Chen Wang and Tom Pittman.[7]
• In 1975 MITS released Altair BASIC, developed by Bill Gates and Paul Allen as the
company Micro-Soft,[8] which eventually grew into corporate giantMicrosoft. The
first Altair version was co-written by Gates, Allen, and Monte Davidoff.
IBM PC, and compatibles
• When IBM was designing the IBM PC they followed the paradigm of existing home-
computers in wanting to have a built-in BASIC. They sourced this from Microsoft -
IBM Cassette BASIC - but Microsoft also produced several other versions of BASIC
for MS-DOS/PC DOS including IBM Disk BASIC(BASIC D), IBM BASICA (BASIC
A), GW-BASIC (a BASICA-compatible version that did not need IBM's ROM)
and QuickBASIC, all typically bundled with the machine. In addition they produced
the Microsoft BASIC Compiler aimed at professional programmers.
• Turbo Pascal-publisher Borland published Turbo Basic 1.0 in 1985 (successor
versions are still being marketed by the original author under the
namePowerBASIC). Microsoft wrote the windowing-based AmigaBASIC that was
supplied with version 1.1 of the pre-emptive multitasking GUI Amiga computers
(late 1985 / early 1986), although the product unusually did not bear any
Microsoft marks.
• These languages introduced many extensions to the original home-computer
BASIC, such as improved string manipulation and graphics support, access to
the file system and additional data types. More important were the facilities
for structured programming, including additional control structures and
proper subroutines supportinglocal variables.
Visual Basic
• BASIC's fortunes reversed once again with the introduction in 1991 of Visual Basic ("VB"), by
Microsoft. This was an evolutionary development of QuickBasic, and included constructs from
other languages such as block structured control statements including With and For Each,
parameterized subroutines, optional static typing, and more recentlyTemplate:2001 a full object
oriented language. But the language retains considerable links to its past, such as the Dim
statement for declarations, Gosub/Return statements, and even line numbers which are still
needed to report errors properly.
• An important driver for the development of Visual Basic was as the new macro language for Excel.
• Ironically, given the origin of BASIC as a "beginner's" language, and apparently even to the surprise
of many at Microsoft who still initially marketed it as a language for hobbyists, the language had
come into widespread use for small custom business applications shortly after the release of VB
version 3.0, which is widely considered the first relatively stable version. While many advanced
programmers still scoffed at its use, VB met the needs of small businesses efficiently wherever
processing speed was less of a concern than ease of development. By that time, computers running
Windows 3.1 had become fast enough that many business-related processes could be completed
"in the blink of an eye" even using a "slow" language, as long as large amounts of data were not
involved. Many small business owners found they could create their own small, yet useful
applications in a few evenings to meet their own specialized needs. Eventually, during the lengthy
lifetime of VB3, knowledge of Visual Basic had become a marketable job skill.
• Microsoft also produced VBScript in 1996 and Visual Basic .NET in 2001. The latter has essentially
the same power as C# and Java but with syntax that reflects the original Basic language.
Recent versions
• Many other BASIC dialects have also sprung up since 1990, including the
open source QB64, Bywater BASIC, Gambas and FreeBASIC - and the
commercial PureBasic, PowerBASIC, RealBasic, and True BASIC (the direct
successor to Dartmouth BASIC from a company controlled by Kurtz).
• Several web-based simple BASIC interpreters also now exist,
including Quite BASIC and Microsoft's Small Basic (educational software).
• Versions of BASIC have been showing up for use on smart phones and
tablets. Apple App Store contains such implementations of BASIC
programming language as smart BASIC, Basic!, HotPaw Basic, BASIC-
II, techBASIC and others. Android devices feature such implementations of
BASIC as RFO BASIC and Mintoris Basic.
• Applications for some mobile computers with proprietary OS (CipherLab)
can be built with programming environment based on BASIC.
• An application for the Nintendo 3DS and Nintendo DSi called Petit
Computer allows for programming in a slightly modified version of BASIC
with DS button support. A 3DS sequel was released in Japan in November
2014.
Windows Command Line
• QBasic, a version of Microsoft QuickBasic without the linker to
make EXE files, is present in the Windows NT and Dos-Windows 95
streams of operating systems and can be obtained for more recent
releases like Windows 7 which do not have them. Prior to Dos 5,
the Basic interpreter was GW-Basic. QuickBasic is part of a series of
three languages issued by Microsoft for the home and office power
user and small scale professional development; QuickC and
QuickPascal are the other two.
• For Windows 95 and 98, which do not have QBasic installed by
default, they can be copied from the installation disc which will
have a set of directories for old and optional software; other
missing commands like Exe2Bin and others are in these same
directories.
• Many Linux distributions include Chipmunk Basic.
Nostalgia
• he ubiquity of BASIC interpreters on personal
computers was such that textbooks once included
simple "Try It In BASIC" exercises that encouraged
students to experiment with mathematical and
computational concepts on classroom or home
computers. Popular computer magazines of the day
typically included type-in programs. Futurist and sci-fi
writer David Brin mourned the loss of ubiquitous BASIC
in a 2006 Salon article[18] as have others who first used
computers during this era. In turn, the article
prompted Microsoft to develop and release Small
Basic.
• References:
http://en.wikipedia.org/wiki/Simplified_Instru
ctional_Computer
• http://en.wikipedia.org/wiki/Comparison_of_
programming_languages
• http://en.wikipedia.org/wiki/BASIC

More Related Content

PPTX
Introduction to Simplified instruction computer or SIC/XE
Temesgen Molla
 
PPT
System software
Senthil Kanth
 
PPT
Overall 23 11_2007_hdp
Mohd Arif
 
PPT
Assembler
Temesgen Molla
 
PDF
system-software-tools
Temesgen Molla
 
PPSX
Spr ch-02
Vasim Pathan
 
PPSX
Spr ch-01
Vasim Pathan
 
PPTX
Part I:Introduction to assembly language
Ahmed M. Abed
 
Introduction to Simplified instruction computer or SIC/XE
Temesgen Molla
 
System software
Senthil Kanth
 
Overall 23 11_2007_hdp
Mohd Arif
 
Assembler
Temesgen Molla
 
system-software-tools
Temesgen Molla
 
Spr ch-02
Vasim Pathan
 
Spr ch-01
Vasim Pathan
 
Part I:Introduction to assembly language
Ahmed M. Abed
 

What's hot (20)

PPT
Assembly language
gaurav jain
 
PPTX
Assembly language programming
himhk
 
PPTX
Part II: Assembly Fundamentals
Ahmed M. Abed
 
PPTX
Assembly language
Arafat Hossan
 
PDF
loaders and linkers
Temesgen Molla
 
PPT
Introduction to Compiler design
Dr. C.V. Suresh Babu
 
PPTX
Pros and cons of c as a compiler language
Ashok Raj
 
PPTX
Intro to assembly language
United International University
 
PPTX
Assembly Language
Ibrahimcommunication Al Ani
 
PPTX
Linkers
Tech_MX
 
PDF
Assembly level language
PDFSHARE
 
PPT
Introduction to compiler
Abha Damani
 
PPT
Compiler Construction
Army Public School and College -Faisal
 
PPTX
Assembly language
shashank puthran
 
PPT
Classification of Compilers
Sarmad Ali
 
PPT
Chapt 01 Assembly Language
Hamza Akram
 
PPTX
Microprocessor chapter 9 - assembly language programming
Wondeson Emeye
 
PPT
Introduction to Compiler
Radhakrishnan Chinnusamy
 
PPT
Compiler Design
Mir Majid
 
Assembly language
gaurav jain
 
Assembly language programming
himhk
 
Part II: Assembly Fundamentals
Ahmed M. Abed
 
Assembly language
Arafat Hossan
 
loaders and linkers
Temesgen Molla
 
Introduction to Compiler design
Dr. C.V. Suresh Babu
 
Pros and cons of c as a compiler language
Ashok Raj
 
Intro to assembly language
United International University
 
Assembly Language
Ibrahimcommunication Al Ani
 
Linkers
Tech_MX
 
Assembly level language
PDFSHARE
 
Introduction to compiler
Abha Damani
 
Assembly language
shashank puthran
 
Classification of Compilers
Sarmad Ali
 
Chapt 01 Assembly Language
Hamza Akram
 
Microprocessor chapter 9 - assembly language programming
Wondeson Emeye
 
Introduction to Compiler
Radhakrishnan Chinnusamy
 
Compiler Design
Mir Majid
 
Ad

Viewers also liked (20)

PPTX
Anciend Egypt
maki_jb
 
PPTX
Chat
fermintoro5
 
PDF
Uchitel
aychin15
 
PPTX
Antena. kelas xii-a kelompok3)(
millah18
 
PDF
postevent NACD 2014mic
Revista Atelierul
 
PPT
презентация к уроку с ЦОР физики 10 класс на тему"газовые законы"
Yulia Zakharova
 
PPTX
レイデトックスエキス
revoplus
 
DOCX
DanaM 0116 plus R6
Dana McLymond
 
ODP
Libertade de expresión jony
afcovelo
 
PDF
Sundance-BIV
Juergen Puetter
 
PDF
Cfwf hub-location-presentation
Clay Bailey
 
PDF
RBC - 15-07-29 BFE Teaser v015.pdf
Juergen Puetter
 
PDF
【水素入浴剤】H2 Performance
revoplus
 
PDF
INDICE
14031998
 
PDF
Brosura-NACD-Cluj-
Revista Atelierul
 
PPSX
France
maki_jb
 
PDF
Could Proposed B.C. refinery be the future of liquid fuels
Juergen Puetter
 
ODP
Xogo miguel joni-oscar
afcovelo
 
PPT
презентация по физике 10 класс на тему "Газовые законы"
Yulia Zakharova
 
PPT
Vincent van gogh , κήπος στο nuenen το
sofikara
 
Anciend Egypt
maki_jb
 
Uchitel
aychin15
 
Antena. kelas xii-a kelompok3)(
millah18
 
postevent NACD 2014mic
Revista Atelierul
 
презентация к уроку с ЦОР физики 10 класс на тему"газовые законы"
Yulia Zakharova
 
レイデトックスエキス
revoplus
 
DanaM 0116 plus R6
Dana McLymond
 
Libertade de expresión jony
afcovelo
 
Sundance-BIV
Juergen Puetter
 
Cfwf hub-location-presentation
Clay Bailey
 
RBC - 15-07-29 BFE Teaser v015.pdf
Juergen Puetter
 
【水素入浴剤】H2 Performance
revoplus
 
INDICE
14031998
 
Brosura-NACD-Cluj-
Revista Atelierul
 
France
maki_jb
 
Could Proposed B.C. refinery be the future of liquid fuels
Juergen Puetter
 
Xogo miguel joni-oscar
afcovelo
 
презентация по физике 10 класс на тему "Газовые законы"
Yulia Zakharova
 
Vincent van gogh , κήπος στο nuenen το
sofikara
 
Ad

Similar to Simplified instructional computer (20)

PPTX
SS-SIC (1).pptx
kalavathisugan
 
PDF
system software 16 marks
vvcetit
 
PDF
Systemsoftwarenotes 100929171256-phpapp02 2
Khaja Dileef
 
PPTX
System Software module 1
ShwetaNirmanik
 
PPT
system software.ppt
byuvashreeitITDept
 
PPT
System Software introduction and SIC machine Architecture
KasthuriKAssistantPr
 
PDF
Examinable Question and answer system programming
Makerere university
 
PDF
System software 5th unit
Sumathi Gnanasekaran
 
PPTX
Sp chap2
sushma sanisetty
 
PPTX
basic assembler functions in system software.pptx
abijithgirish11b
 
PPTX
Module 1-System Software PROGRAMS.pptx
ssuser47f7f2
 
PPT
Module 1-ppt System programming
vishnu sankar
 
PPTX
Class2
guest046c293
 
PPT
Material com Conceitos de Assembler Mainframe
Flavio787771
 
PPTX
CSe_Cumilla Bangladesh_Country CSE CSE213_5.ppt
roy5th6th
 
PPSX
Processors used in System on chip
Dr. A. B. Shinde
 
PPTX
2024_lecture12_come321.pptx..................
ghada507476
 
PPTX
Instruction set.pptx
ssuser000e54
 
PPT
Assembler design option
Mohd Arif
 
PPT
Assembly language programming implemenation
FazalHameed14
 
SS-SIC (1).pptx
kalavathisugan
 
system software 16 marks
vvcetit
 
Systemsoftwarenotes 100929171256-phpapp02 2
Khaja Dileef
 
System Software module 1
ShwetaNirmanik
 
system software.ppt
byuvashreeitITDept
 
System Software introduction and SIC machine Architecture
KasthuriKAssistantPr
 
Examinable Question and answer system programming
Makerere university
 
System software 5th unit
Sumathi Gnanasekaran
 
basic assembler functions in system software.pptx
abijithgirish11b
 
Module 1-System Software PROGRAMS.pptx
ssuser47f7f2
 
Module 1-ppt System programming
vishnu sankar
 
Class2
guest046c293
 
Material com Conceitos de Assembler Mainframe
Flavio787771
 
CSe_Cumilla Bangladesh_Country CSE CSE213_5.ppt
roy5th6th
 
Processors used in System on chip
Dr. A. B. Shinde
 
2024_lecture12_come321.pptx..................
ghada507476
 
Instruction set.pptx
ssuser000e54
 
Assembler design option
Mohd Arif
 
Assembly language programming implemenation
FazalHameed14
 

Recently uploaded (20)

PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 

Simplified instructional computer

  • 2. The Simplified Instructional Computer • (also abbreviated SIC) is a hypothetical computer system introduced in System Software: An Introduction to Systems Programming, by Leland Beck. Due to the fact that most modern microprocessors include subtle, complex functions for the purposes of efficiency, it can be difficult to learn systems programming using a real-world system. The Simplified Instructional Computer solves this by abstracting away these complex behaviors in favor of an architecture that is clear and accessible for those wanting to learn systems programming.
  • 3. SIC Architecture • The SIC machine has basic addressing, storing most memory addresses hexadecimal integer format. Similar to most modern computing systems, the SIC architecture stores all data in binary and uses the two's complement to represent negative values at the machine level. Memory storage in SIC consists of 8-bit bytes, and all memory addresses in SIC are byte addresses. Any three consecutive bytes form a 24-bit 'word' value, addressed by the location of the lowest numbered byte in the word value. Numeric values are stored as word values, and character values use the 8-bit ASCII system. The SIC machine does not support floating-point hardware and have at most 32,768 bytes of memory. There is also a more complicated machine built on top of SIC called the Simplified Instruction Computer with Extra Equipment (SIC/XE). The XE expansion of SIC adds a 48-bit floating point data type, an additional memory addressing mode, and extra memory (1 megabyte instead of 32,768 bytes) to the original machine. All SIC assembly code is upwards compatible with SIC/XE. • SIC machines have several registers, each 24 bits long and having both a numeric and character representation: • A (0): Used for basic arithmetic operations; known as the accumulator register. • X (1): Stores and calculates addresses; known as the index register. • L (2): Used for jumping to specific memory addresses and storing return addresses; known as the linkage register. • PC (8): Contains the address of the next instruction to execute; known as the program counter register. • SW (9): Contains a variety of information, such as carry or overflow flags; known as the status word register. • In addition to the standard SIC registers, there are also four additional general-purpose registers specific to the SIC/XE machine: • B (3): Used for addressing; know as the base register. • S (4): No special use, general purpose register. • T (5): No special use, general purpose register. • F (6): Floating point accumulator register (This register is 48-bits instead of 24). • These five/nine registers allow the SIC or SIC/XE machine to perform most simple tasks in a customized assembly language. In the System Software book, this is used with a theoretical series of operation codes to aid in the understanding of assemblers and linker-loaders required for the execution of assembly language code.
  • 4. Addressing Modes for SIC and SIC/XE • The Simplified Instruction Computer has three instruction formats, and the Extra Equipment add-on includes a fourth. The instruction formats provide a model for memory and data management. Each format has a different representation in memory: • Format 1: Consists of 8 bits of allocated memory to store instructions. • Format 2: Consists of 16 bits of allocated memory to store 8 bits of instructions and two 4- bits segments to store operands. • Format 3: Consists of 6 bits to store an instruction, 6 bits of flag values, and 12 bits of displacement. • Format 4: Only valid on SIC/XE machines, consists of the same elements as format 3, but instead of a 12-bit displacement, stores a 20-bit address. • Both format 3 and format 4 have six-bit flag values in them, consisting of the following flag bits: • n: Indirect addressing flag • i: Immediate addressing flag • x: Indexed addressing flag • b: Base address-relative flag • p: Program counter-relative flag • e: Format 4 instruction flag
  • 5. SIC Assembly Syntax • SIC uses a special assembly language with its own operation codes that hold the hex values needed to assemble and execute programs. A sample program is provided below to get an idea of what a SIC program might look like. In the code below, there are three columns. The first column represents a forwarded symbol that will store its location in memory. The second column denotes either a SIC instruction (opcode) or a constant value (BYTE or WORD). The third column takes the symbol value obtained by going through the first column and uses it to run the operation specified in the second column. This process creates an object code, and all the object codes are put into an object file to be ran by the SIC machine.
  • 6. • COPY START 1000 FIRST STL RETADR CLOOP JSUB RDREC LDA LENGTH COMP ZERO JEQ ENDFIL JSUB WRREC J CLOOP ENDFIL LDA EOF STA BUFFER LDA THREE STA LENGTH JSUB WRREC LDL RETADR RSUB EOF BYTE C'EOF' THREE WORD 3 ZERO WORD 0 RETADR RESW 1 LENGTH RESW 1 BUFFER RESB 4096 . . SUBROUTINE TO READ RECORD INTO BUFFER .
  • 7. • RDREC LDX ZERO LDA ZERO RLOOP TD INPUT JEQ RLOOP RD INPUT COMP ZERO JEQ EXIT STCH BUFFER,X TIX MAXLEN JLT RLOOP EXIT STX LENGTH RSUB INPUT BYTE X'F1' MAXLEN WORD 4096 . . SUBROUTINE TO WRITE RECORD FROM BUFFER .
  • 8. • WRREC LDX ZERO WLOOP TD OUTPUT JEQ WLOOP LDCH BUFFER,X WD OUTPUT TIX LENGTH JLT WLOOP RSUB OUTPUT BYTE X'06' END FIRST
  • 9. • If you were to assemble this program, you would get the object code depicted below. The beginning of each line consists of a record type and hex values for memory locations. For example, the top line is an 'H' record, the first 6 hex digits signify its relative starting location, and the last 6 hex digits represent the program's size. The lines throughout are similar, with each 'T' record consisting of 6 hex digits to signify that line's starting location, 2 hex digits to indicate the size (in bytes) of the line, and the object codes that were created during the assembly process. • HCOPY 00100000107A T0010001E1410334820390010362810303010154820613C100300102A0C 103900102D T00101E150C10364820610810334C0000454F46000003000000 T0020391E041030001030E0205D30203FD8205D2810303020575490392C 205E38203F T0020571C1010364C0000F1001000041030E02079302064509039DC2079 2C1036 T002073073820644C000006 E001000
  • 10. Emulating the SIC System • Since the SIC and SIC/XE machines are not real machines, the task of actually constructing a SIC emulator is often part of coursework in a systems programming class. The purpose of SIC is to teach introductory-level systems programmers or collegiate students how to write and assemble code below higher-level languages like C and C++. With that being said, there are some sources of SIC-emulating programs across the web, however infrequent they may be. • An assembler and a simulator written by the author, Leland in Pascal is available on his educational home page at ftp://rohan.sdsu.edu/faculty/beck • SIC/XE Simulator And Assembler downloadable at https://sites.google.com/site/sarimohsultan/Projects/sic-xe- simulator-and-assembler • SIC Emulator, Assembler and some example programs written for SIC downloadable at http://sicvm.sourceforge.net/home.php
  • 11. Comparison of programming languages • is a common topic of discussion among software engineers. Basic instructions of severalprogramming languages are compared here.
  • 12. • Conventions of this article • The bold is the literal code. The non-bold is interpreted by the reader. Statements in guillemets (« … ») are optional. Tab ↹indicates a necessary indent (with whitespace).
  • 13. Type identifiers • 8 bit (byte)16 bit (short integer)32 bit64 bit (long integer)Word sizeArbitrarily precise (bignum)SignedUnsignedSignedUnsignedSignedUnsignedSignedUnsignedSignedUnsignedAda[1]range -2**7 .. 2**7 - 1[j]range 0 .. 2**8 - 1[j] ormod 2**8[k]range -2**15 .. 2**15 - 1[j]range 0 .. 2**16 - 1[j] ormod 2**16[k]range -2**31 .. 2**31 - 1[j]range 0 .. 2**32 - 1[j] ormod 2**32[k]range - 2**63 .. 2**63 - 1[j]mod 2**64[k]Integer[j]range 0 .. 2**Integer'Size - 1[j] ormod Integer'Size[k]N/AALGOL 68(variable-width)short short int[c]N/Ashort int[c]N/Aint[c]N/Along int[c]N/Aint[c]N/Along long int [a][g]bytes & bitsC (C99fixed-width)int8_tuint8_tint16_tuint16_tint32_tuint32_tint64_tuint64_tintunsigned intN/AC++ (C++11fixed-width)C (C99variable- width)signed charunsigned charshort[c]unsigned short[c]long[c]unsigned long[c]long long[c]unsigned long long[c]C++ (C++11variable-width)Objective-Csigned charunsigned charshort[c]unsigned short[c]long[c]unsigned long[c]long long[c]unsigned long long[c]int or NSIntegerunsigned int or NSUIntegerC#sbytebyteshortushortintuintlongulongIntPtrUIntPtrSystem.Numerics.BigInteger (.NET 4.0)JavabyteN/Achar[b]N/AN/AN/AN/Ajava.math.BigIntegerGoint8uint8 orbyteint16uint16int32uint32int64uint64intuintbig.IntSwiftInt8UInt8Int16UInt16Int32UInt32Int64UInt64IntUIntD byteubyteshortushortintuintlongulongN/AN/ABigIntCommon Lisp[2]bignumSchemeISLISP[3]bignumPascal(FPC)shortintbytesmallintwordlongintlongwordint64qwordintegercardinalN/AVisual BasicN/AByteIntegerN/ALongN/AN/AN/AN/AVisual Basic .NETSByteShortUShortIntegerUIntegerLongULongSystem.Numerics.BigInteger (.NET 4.0)FreeBasicByte orInteger<8>UByte orUInteger<8>Short orInteger<16>UShort orUInteger<16>Long orInteger<32>ULong orUInteger<32>LongInt orInteger<64>ULongInt orUInteger<64> IntegerUIntegerN/APython 2.xN/AN/AN/AN/AintN/AlongPython 3.xN/AN/AN/AN/AN/AintS-LangN/AN/AN/AN/AN/AN/AFortranINTEGER(KIND = n)[f]N/AINTEGER(KIND = n)[f]N/AINTEGER(KIND = n)[f]N/AINTEGER(KIND = n)[f]N/APHPN/AN/Aint [m]N/Aint [m]N/AN/A[e]Perl 5N/A[d]N/A[d]N/A[d]N/A[d]N/A[d]Math::BigIntPerl 6int8uint8int16uint16int32uint32int64uint64IntN/ARubyN/AN/AN/AN/AFixnumN/ABignumErlang[n]N/AN/AN/AN/Ainteger()N/Ainteger()[o]ScalaByteN/AShortChar[l]IntN/ALongN/AN/AN/ Ascala.math.BigIntSeed7N/AN/AN/AN/AN/AN/AintegerN/AN/AN/AbigIntegerSmalltalkN/AN/AN/AN/ASmallInteger[i]N/ALargeInteger[i]Windows PowerShellN/AN/AN/AN/AN/AN/AOCamlN/AN/Aint32N/Aint64N/Aint or nativeintopen Big_int;; big_intF#sbytebyteint16uint16int32 or intuint32uint64nativeintunativeintbigintStandard MLN/AWord8.wordN/AInt32.intWord32.wordInt64.intWord64.wordintwordLargeInt.int or IntInf.intHaskell(GHC)«import Int» Int8«import Word» Word8«import Int» Int16«import Word» Word16«import Int» Int32«import Word» Word32«import Int» Int64«import Word» Word64Int«import Word» WordIntegerEiffelINTEGER_8NATURAL_8INTEGER_16NATURAL_16INTEGER_32NATURAL_32INTEGER_64NATURAL_64INTEGERNATURALN/ACOBOL[h]BINARY-CHAR «SIGNED»BINARY- CHAR UNSIGNEDBINARY-SHORT «SIGNED»BINARY-SHORT UNSIGNEDBINARY-LONG «SIGNED»BINARY-LONG UNSIGNEDBINARY-DOUBLE «SIGNED»BINARY-DOUBLE UNSIGNEDN/AN/AN/AMathematicaN/AN/AN/AN/AN/AInteger
  • 14. • ^a The standard constants int shorts and int lengths can be used to determine how many 'short's and 'long's can be usefully prefixed to 'short int' and 'long int'. The actually size of the 'short int', 'int' and 'long int' is available as constants short max int, max int and long max int etc. ^b Commonly used for characters. ^c The ALGOL 68, C and C++ languages do not specify the exact width of the integer types short, int, long, and (C99, C++11) long long, so they are implementation-dependent. In C and C++ short, long, and long long types are required to be at least 16, 32, and 64 bits wide, respectively, but can be more. The int type is required to be at least as wide as short and at most as wide as long, and is typically the width of the word size on the processor of the machine (i.e. on a 32-bit machine it is often 32 bits wide; on 64-bit machines it is often 64 bits wide). C99 and C++11[citation needed] also define the [u]intN_t exact-width types in the stdint.h header. SeeC syntax#Integral types for more information. ^d Perl 5 does not have distinct types. Integers, floating point numbers, strings, etc. are all considered "scalars". ^e PHP has two arbitrary-precision libraries. The BCMath library just uses strings as datatype. The GMP library uses an internal "resource" type.
  • 15. • ^f The value of "n" is provided by the SELECTED_INT_KIND[4] intrinsic function. ^g ALGOL 68G's run time option --precision "number" can set precision for long long ints to the required "number" significant digits. The standard constants long long int widthand long long max int can be used to determine actual precision. ^h COBOL allows the specification of a required precision and will automatically select an available type capable of representing the specified precision. "PIC S9999", for example, would required a signed variable of four decimal digits precision. If specified as a binary field, this would select a 16 bit signed type on most platforms. ^i Smalltalk automatically chooses an appropriate representation for integral numbers. Typically, two representations are present, one for integers fitting the native word size minus any tag bit (SmallInteger) and one supporting arbitrary sized integers (LargeInteger). Arithmetic operations support polymorphic arguments and return the result in the most appropriate compact representation.
  • 16. • ^j Ada range types are checked for boundary violations at run-time (as well as at compile-time for static expressions). Run time boundary violations raise a "constraint error" exception. Ranges are not restricted to powers of two. Commonly predefined Integer subtypes are: Positive (range 1 .. Integer'Last) and Natural (range 0 .. Integer'Last).Short_Short_Integer (8 bit), Short_Integer (16 bit) and Long_Integer (64 bit) are also commonly predefined, but not required by the Ada standard. Run time checks can be disabled if performance is more important than integrity checks. ^k Ada modulo types implement modulo arithmetic in all operations, i.e. no range violations are possible. Modulos are not restricted to powers of two. ^l Commonly used for characters like Java's char. ^m int in PHP has the same width as long type in C has on that system [c]. ^n Erlang is dynamically typed. The type identifiers are usually used to specify types of record fields and the argument and return types of functions.[5] ^o When it exceeds 1 word.[6]
  • 17. • Floating point[edit] • Single precisionDouble precisionProcessor dependentAda[1]FloatLong_FloatN/AALGOL 68real[a]long real[a]short real, long long real, etc.[d]Cfloat[b]doublelong double[f]Objective- CC++ (STL)C#floatN/AJavaGofloat32float64SwiftFloa tDoubleDfloatdoublereal
  • 18. • Common LispSchemeISLISPPascal (Free Pascal)singledoublerealVisual BasicSingleDoubleN/AVisual Basic .NETXojoPythonN/AfloatJavaScriptNumber[7]N /A
  • 21. BASIC • BASIC (an acronym for Beginner's All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use. • In 1964, John G. Kemeny and Thomas E. Kurtz designed the original BASIC language at Dartmouth College in New Hampshire. They wanted to enable students in fields other than science and mathematics to use computers. At the time, nearly all use of computers required writing custom software, which was something only scientists and mathematicians tended to learn. • Versions of BASIC became widespread on microcomputers in the mid-1970s and 1980s. Microcomputers usually shipped with BASIC, often in the machine's firmware. Having an easy-to-learn language on these early personal computers allowed small business owners, professionals, hobbyists, and consultants to develop custom software on computers they could afford. • BASIC remains popular in many dialects and in new languages influenced by BASIC, such as Microsoft's Visual Basic. In 2006, 59% of developers for the .NET Framework used Visual Basic .NET as their only programming language.
  • 22. History • Before the mid-1960s, computers were extremely expensive mainframe machines, usually requiring a dedicated computer room and air-conditioning, used by large organizations for scientific and commercial tasks. Users submitted jobs, on punched cards or similar media, to computer operators, and usually collected the output later. A simple batch processing arrangement ran only a single "job" at a time, one after another. During the 1960s faster and more affordable computers, still mainframes, became available, and time-sharing—a technique which allows multiple users or processes to share use of the CPU and memory—was developed. In such a system the operating system gives each of several processes time on the CPU, then pauses it and switches to another; each process behaves as if it had full use of the computer, although the time to complete its operation increases. Time- sharing was initially used to allow several batched processes to execute simultaneously. • Time-sharing also allowed several independent users to interact with a computer, working on terminals with keyboards and teletype printers, and later display screens. Computers were fast enough to respond quickly to each user. • The need to optimize interactive time-sharing, using command line interpreters and programming languages, was an area of intense research during the 1960s and 1970s.
  • 23. Origin • The original BASIC language was designed on May 1, 1964 by John Kemeny and Thomas Kurtz[2] and implemented by a team of Dartmouth students under their direction. The acronymBASIC comes from the name of an unpublished paper by Thomas Kurtz.[3] BASIC was designed to allow students to write mainframe computer programs for the Dartmouth Time-Sharing System. It was intended specifically for less technical users who did not have or want the mathematical background previously expected. Being able to use a computer to support teaching and research was quite novel at the time. • The language was based on FORTRAN II, with some influences from ALGOL 60 and with additions to make it suitable for timesharing. Initially, BASIC concentrated on supporting straightforward mathematical work, with matrix arithmetic support from its initial implementation as a batch language, and character string functionality being added by 1965. • The designers of the language decided to make the compiler available free of charge so that the language would become widespread. (In the 1960s software became a chargeable commodity; until then it was provided without charge as a service with the very expensive computers, usually available only to lease.) They also made it available to high schools in theHanover area, and put a considerable amount of effort into promoting the language. In the following years, as other dialects of BASIC appeared, Kemeny and Kurtz's original BASIC dialect became known as Dartmouth BASIC.
  • 24. Spread on minicomputers • Knowledge of the relatively simple BASIC became widespread for a computer language, and it was implemented by a number of manufacturers, becoming fairly popular on newer minicomputers such as the DEC PDP series and the Data General Nova. The BASIC language was also central to the HP Time-Shared BASIC system in the late 1960s and early 1970s, where the language was implemented as an interpreter. Also at this time it was ported into the Pick operating system where a compiler renders it into bytecode, able to be interpreted by a virtual machine. • During this period a number of simple computer games were written in BASIC, most notably Mike Mayfield's Star Trek. A number of these were collected by DEC employee David H. Ahl and published in a newsletter he compiled. He later collected a number of these into book form, "101 BASIC Computer Games", which was first published in 1973.[4][5] During the same period, Ahl was involved in the creation of a small computer for education use, an early personal computer. When management refused to support the concept, Ahl left DEC in 1974 to found the seminal computer magazine,Creative Computing. The book remained popular, and was re-published on several occasions.
  • 25. Explosive growth: the home computer era • he 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. • One of the first to appear was Tiny BASIC, a simple BASIC variant designed by Dennis Allison at the urging of Bob Albrecht of the Homebrew Computer Club. He had seen BASIC on minicomputers and felt it would be the perfect match for new machines like the MITS Altair 8800. How to design and implement a stripped-down version of an interpreter for the BASIC language was covered in articles by Allison in the first three quarterly issues of thePeople's Computer Company newsletter published in 1975 and implementations with source code published in Dr. Dobb's Journal of Tiny BASIC Calisthenics & Orthodontia: Running Light Without Overbyte. Versions were written by Li-Chen Wang and Tom Pittman.[7] • In 1975 MITS released Altair BASIC, developed by Bill Gates and Paul Allen as the company Micro-Soft,[8] which eventually grew into corporate giantMicrosoft. The first Altair version was co-written by Gates, Allen, and Monte Davidoff.
  • 26. IBM PC, and compatibles • When IBM was designing the IBM PC they followed the paradigm of existing home- computers in wanting to have a built-in BASIC. They sourced this from Microsoft - IBM Cassette BASIC - but Microsoft also produced several other versions of BASIC for MS-DOS/PC DOS including IBM Disk BASIC(BASIC D), IBM BASICA (BASIC A), GW-BASIC (a BASICA-compatible version that did not need IBM's ROM) and QuickBASIC, all typically bundled with the machine. In addition they produced the Microsoft BASIC Compiler aimed at professional programmers. • Turbo Pascal-publisher Borland published Turbo Basic 1.0 in 1985 (successor versions are still being marketed by the original author under the namePowerBASIC). Microsoft wrote the windowing-based AmigaBASIC that was supplied with version 1.1 of the pre-emptive multitasking GUI Amiga computers (late 1985 / early 1986), although the product unusually did not bear any Microsoft marks. • These languages introduced many extensions to the original home-computer BASIC, such as improved string manipulation and graphics support, access to the file system and additional data types. More important were the facilities for structured programming, including additional control structures and proper subroutines supportinglocal variables.
  • 27. Visual Basic • BASIC's fortunes reversed once again with the introduction in 1991 of Visual Basic ("VB"), by Microsoft. This was an evolutionary development of QuickBasic, and included constructs from other languages such as block structured control statements including With and For Each, parameterized subroutines, optional static typing, and more recentlyTemplate:2001 a full object oriented language. But the language retains considerable links to its past, such as the Dim statement for declarations, Gosub/Return statements, and even line numbers which are still needed to report errors properly. • An important driver for the development of Visual Basic was as the new macro language for Excel. • Ironically, given the origin of BASIC as a "beginner's" language, and apparently even to the surprise of many at Microsoft who still initially marketed it as a language for hobbyists, the language had come into widespread use for small custom business applications shortly after the release of VB version 3.0, which is widely considered the first relatively stable version. While many advanced programmers still scoffed at its use, VB met the needs of small businesses efficiently wherever processing speed was less of a concern than ease of development. By that time, computers running Windows 3.1 had become fast enough that many business-related processes could be completed "in the blink of an eye" even using a "slow" language, as long as large amounts of data were not involved. Many small business owners found they could create their own small, yet useful applications in a few evenings to meet their own specialized needs. Eventually, during the lengthy lifetime of VB3, knowledge of Visual Basic had become a marketable job skill. • Microsoft also produced VBScript in 1996 and Visual Basic .NET in 2001. The latter has essentially the same power as C# and Java but with syntax that reflects the original Basic language.
  • 28. Recent versions • Many other BASIC dialects have also sprung up since 1990, including the open source QB64, Bywater BASIC, Gambas and FreeBASIC - and the commercial PureBasic, PowerBASIC, RealBasic, and True BASIC (the direct successor to Dartmouth BASIC from a company controlled by Kurtz). • Several web-based simple BASIC interpreters also now exist, including Quite BASIC and Microsoft's Small Basic (educational software). • Versions of BASIC have been showing up for use on smart phones and tablets. Apple App Store contains such implementations of BASIC programming language as smart BASIC, Basic!, HotPaw Basic, BASIC- II, techBASIC and others. Android devices feature such implementations of BASIC as RFO BASIC and Mintoris Basic. • Applications for some mobile computers with proprietary OS (CipherLab) can be built with programming environment based on BASIC. • An application for the Nintendo 3DS and Nintendo DSi called Petit Computer allows for programming in a slightly modified version of BASIC with DS button support. A 3DS sequel was released in Japan in November 2014.
  • 29. Windows Command Line • QBasic, a version of Microsoft QuickBasic without the linker to make EXE files, is present in the Windows NT and Dos-Windows 95 streams of operating systems and can be obtained for more recent releases like Windows 7 which do not have them. Prior to Dos 5, the Basic interpreter was GW-Basic. QuickBasic is part of a series of three languages issued by Microsoft for the home and office power user and small scale professional development; QuickC and QuickPascal are the other two. • For Windows 95 and 98, which do not have QBasic installed by default, they can be copied from the installation disc which will have a set of directories for old and optional software; other missing commands like Exe2Bin and others are in these same directories. • Many Linux distributions include Chipmunk Basic.
  • 30. Nostalgia • he ubiquity of BASIC interpreters on personal computers was such that textbooks once included simple "Try It In BASIC" exercises that encouraged students to experiment with mathematical and computational concepts on classroom or home computers. Popular computer magazines of the day typically included type-in programs. Futurist and sci-fi writer David Brin mourned the loss of ubiquitous BASIC in a 2006 Salon article[18] as have others who first used computers during this era. In turn, the article prompted Microsoft to develop and release Small Basic.