



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




-^
Java
(Visual) Basic
Perl
Python
JavaScript
Ruby
-^
Java
also
a^
strong
showing
-^
Python
worth
a^
peek
-^
compiled
code
runs
FAST
-^
allows
low
โlevel
device
control
-^
a^ foundation
of
the
programming
world
-^
strings
are
a^ pain
in
the
@$$
-^
awkward
conventions
(pointers
can
be
difficult
to
learn)
-^
requires
a^ compiler
first
include
is^
so we
have
access
to
printf
(standard
I/O)
-^
define
the
main
program
(must
be
called
main
)^ to
take
no
arguments
(thus
void
)^ and
return
an
integer
-^
braces
surround
the
program
-^
value
of
integer,
i,
in
formatted
line
-^
return
zero
(common
return
value
for
successful
program)
-^ output
will
be:
0053
-^
-^
k++
adds
one
to^
variable:
same
as k^
same
as k^
k^
-^
-^
-^
-^
-^
int
k,count; count
for
(k=0;
k
k++)
count
count
printf
(โcount
%d\nโ,count);
#include
โฆdouble
x,y,z,pi,ampl=3.0,sigma=1.2; pi^
x^
sin(60.0*pi/180.0); y^
sqrt(fabs(2*x
pi));
z^
amplexp(-0.5pow(x/sigma,2.0))
int
i,j=2,k=3; double
x,y,z; i^
x^
y^
z^
printf("i
%d;
x
%f;
y
%f;
z
%f;
other
%f\n",i,x,y,z,j/k);
i^
x
y
z
other
-^
parallel
port
access
in
linux/unix
is very
straightforward
-^
Windows
98
and
before
was
also
easy
-^
new
Hardware
Abstraction
Layer
(HAL)
gets
in
the
way
-^
this
inpout
package
bridges
the
HAL
-^
see
www.logix4u.net
to
get
the
package
(already
installed
on
MHA
โ^3574
machines)
-^
http://www.hytherion.com/beattidp/comput/pport.htm
for
test
programs
-^
discussed
at
end
of
lecture
-^
runs
25
times
slower
than
the
inpout
version
-^ because
#include
#include
#include
#define
0xD
usu.
0x
if
built-in
typedef
void
(_stdcall
*oupfuncPtr)(short
portaddr,
short
datum);
oupfuncPtr
oup32fp;
void
Out32(short
portaddr,
short
datum){
(oup32fp)(portaddr,datum);
int
main(void) {
hLib;
short
x=0xAA;
value
to
write
(expr.
in
hex)
hLib
LoadLibrary("inpout32.dll"); oup32fp
(oupfuncPtr)
GetProcAddress(hLib,
"Out32");
Out32(PPORT_BASE,x);
the
actual
output
command
FreeLibrary(hLib);return
outval
outval
short
outval
for
way
to
make
infinite
loop:
kills
outval
outval
Out32(PPORT_BASE,outval); }