LSB reference summary.pdf

1 ASCII TABLE
2 ASCII TABLE (DOS)
3 ASCII TABLE (Window)
4 Keyboard Codes
The Diagram below shows the codes that are returned when a key is pressed.
For example, pressing ‘a’ would return 0x61.
If it is an extended key, the code is shown as “0,XX” where XX is the extended code
Esc
F1
F2
1B
(1B)
<1B>
[]
0,3B
(0,54)
<0,5E>
[0,68]
0,3C
(0,55)
<0,5F>
[0,69]
F3
F4
0,3D
0,3E
(0,56) (0,57)
<0,60> <0,61>
[0,6A] [0,6B]
F5
F6
F7
F8
0,3F
0,40
0,41
0,42
(0,58) (0,59) (0,5A) (0,5B)
<0,62> <0,63> <0,64> <0,65>
[0,6C] [0,6D] [0,6E] [0,6F]
F9
F10
0,43
0,44
(0,5C) (0,5D)
<0,66> <0,67>
[0,70] [0,71]
F11
F12
Print
0,85
(0,)
<0,>
[0,]
0,86
(0,)
<0,>
[0,]
2A()
<0,72>
[]
~
!
@
#
$
%
^
&
*
(
)
_
+
BackSpace
`
1
2
3
4
5
6
7
8
9
0
=
60(7E) 31(21) 32(40) 33(23) 34(24) 35(25) 36(5E) 37(26) 38(2A) 39(28) 30(29) 2D(5F) 2B(2B)
08(08)
<>
<>
<0,3>
<>
<>
<>
<1E>
<>
<>
<>
<>
<1F>
<>
<7F>
[]
[0,78] [0,79] [0,7A] [0,7B] [0,7C] [0,7D] [0,7E] [0,7F] [0,80] [0,81] [0,82] [0,83]
[]
{
}
Tab
Q
W
E
R
T
Y
U
I
O
P
[
]
71(51) 77(57) 65(45) 72(52) 74(54) 79(59) 75(55) 69(49) 6F(4F) 70(50) 5B(7B) 5D(7D)
<11> <17> <05> <12> <14> <19> <15> <09> <0F> <10> <1B> <1D>
Enter
[0,10] [0,11] [0,12] [0,13] [0,14] [0,15] [0,16] [0,17] [0,18] [0,19]
[]
[]
:
“
Caps Lock
A
S
D
F
G
H
J
K
L
;
‘
61(41) 73(53) 64(44) 66(46) 67(47) 68(48) 6A(4A) 6B(4B) 6C(4C) 3B(3A) 27(22)
0D(0D)
<01> <13> <04> <06> <07> <08> <0A> <0B> <0C>
<>
<>
<0A>
[0,1E] [0,1F] [0,20] [0,21] [0,22] [0,23] [0,24] [0,25] [0,26]
[]
[]
[]
<
>
?
Shift
Z
X
C
V
B
N
M
Shift
,
/
.
7A(5A) 78(58) 63(43) 76(56) 62(42) 6E(4E) 6D(4D) 2C(3C) 2E(3E) 2F(3F)
<1A> <18> <03> <16> <02> <0E> <0D>
<>
<>
<>
[0,2C] [0,2D] [0,2E] [0,2F] [0,30] [0,31] [0,32]
[]
[]
[]
|
Ctrl
Alt
Macro
Space
Alt
Ctrl
\
()
20(20)
5C(7C)
<>
<20>
<1C>
[]
[20]
[]
Scroll Pause
Lock
()
Insert Home
0,52
()
<>
Delete
0,47
()
<>
End
0,53
()
<>
0,4F
()
<>
Page
Up
0,49
()
<>
Page
Down
0,51
()
<>
u
s
0,48
()
<>
v
t
0,4B
()
<>
0,50
()
<>
0,4D
()
<>
CODE
(in
LEGEND
Hexadecimal)
Normal- XX
Extended Shift(XX)
Code- 0,XX Control- <XX>
Alt[XX]
Num
Lock
/
7
8
Home
u
0,47
0,48
(37)
(38)
<0,77> <>
4
5
s
0,4B
(34)
(35)
<0,73> <>
1
2
End
v
0,4F
0,50
(31)
(32)
<0,75> <>
0
Insert
0,52
(30)
<>
*
-
9
Pg Up
0,49
(39)
+
<0,84>
6
t
0,4D
(36)
<0,74>
3
Pg Dn
0,51
(33) Enter
<0,76>
.
Del
0,53
(2E)
<>
5 Other References
“Printf” Escape Sequences
Color
Code
Black
0
Blue
1
Green
2
Cyan
3
Red
4
Magenta
5
Brown
6
Light Grey
7
Dark Grey
8
Light Blue
9
Light Green
10
Light Cyan
11
Light Red
12
Light Magenta
13
Yellow
14
White
15
Blink
+128
Foregound
C Numeric Data Types
Keyword
Varible Type
char
Int
short int
Long
character (for string)
interger
short integer
long integer
unsigned char
unsigned int
unsigned short
unsigned long
float
unsigned character
unsigned integer
unsigned short integer
unsigned long integer
single-precision floating point (accurate
to 7 digits)
double-precision floating point
(accurate to 15 digits)
double
Background
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Range
-128 to 127
-32,768 to 32,767
-32,768 to 32,767
-2,147,483,648 to
2,147,483,647
0 to 255
0 to 65,535
0 to 65,535
0 to 4,294,967,295
38
-38
3.4 x 10 to 3.4 x 10
1.7 x 10
308
to 1.7 x 10
“Printf” Conversion Characters
Conversion
Display Argument (Variable’s contents) as
Character
%c
single character
%d
signed decimal integer (int)
%e
signed floating-point value in E notation
%f
signed floating-point value (float)
%g
signed value in %e or %f format, whichever is shorter
%i
signed decimal integer (int)
%o
unsigned octal (base 8) integer (int)
%s
string of text
%u
unsigned decimal integer (int)
%x
unsigned hexadecimal (base 16) integer (int)
%ld
signed decimal integer (long)
%lf
signed floating-point value (double)
“Printf” Escape Sequences
Sequence
Represents
\a
The speaker beeping
\b
Backspace (move the cursor back, no erase)
\f
Form feed (eject printer page: ankh character on the screen)
\n
Newline, like pressing the Enter key
\r
Carriage return (moves the cursor to the beginning of the line)
\t
Tab
\v
Vertical tab (moves the cursor down a line)
\\
The backslash character
\’
The apostrophe
\”
The double-quote character
\?
The question mark
\0
The “null” byte (backslash-zero)
\O
A character value in octal (base 8)
\xH
A character value in hexadecimal (base 16)
-308
Storage
Required
1 byte
2 byte
2 byte
4 byte
1 byte
2 byte
2 byte
4 byte
4 byte
8 byte
Music Notes Frequency in Hertz
Notes
Frequency Notes
c2
0 to 8
c4
Treble
Base
Octaves
middle c
>middle c
<middle c
d2
e2
f2
g2
a0
b0
c1
d1
e1
f1
g1
a1
b1
27.500
29.135
30.868
32.703
34.648
36.708
38.891
41.203
43.654
46.249
48.999
51.913
55.000
58.270
61.735
a2
b2
c3
d3
e3
f3
g3
a3
b3
Frequency
65.406
69.296
73.416
77.782
82.407
87.307
92.499
97.999
103.83
110.00
116.54
123.47
130.81
138.59
146.83
155.56
164.81
174.61
185.00
196.00
207.65
220.00
233.08
246.94
Parallel Port Configuration
Pin
Bit
Direction
2
D0
Data output
3
D1
Data output
4
D2
Data output
5
D3
Data output
6
D4
Data output
7
D5
Data output
8
D6
Data output
9
D7
Data output
15
D3
Control in
13
D4
Control in
12
D5
Control in
10
D6
Control in
11
D7
Control in
1
D0
Control out
14
D1
Control out
16
D2
Control out
17
D3
Control out
18-25
Gnd
Port no.
Data Out
1
3BC
2
378
3
278
C programming code for Parallel Port
#DEFINE LPT 0x378
char data;
outportb(LPT,data);
data=inportb(LPT);
Notes
c4
d4
e4
f4
g4
a4
b4
c5
d5
e5
f5
g5
a5
b5
Frequency
261.63
277.18
293.66
311.13
329.63
349.23
369.99
392.00
415.30
440.00
466.16
493.88
523.25
554.37
587.23
622.25
659.26
698.46
739.99
783.99
830.61
880.00
932.33
987.77
Inverted?
•
•
•
•
•
Control In
3BD
379
279
Notes
c6
d6
e6
f6
g6
a6
b6
c7
d7
e7
f7
g7
a7
b7
c8
Frequency
1046.5
1108.7
1174.7
1244.5
1318.5
1396.9
1480.0
1568.0
1661.2
1760.0
1864.7
1975.5
2093.0
2217.5
2349.3
2489.0
2637.0
2793.8
2960.0
3136.0
3322.4
3520.0
3729.3
3951.1
4186.0
Background
Error
Select out
Printer empty
Acknowledge
Printer busy
Data strobe
Auto feed
Initialize printer
Select in
Control Out
3BE
37A
27A
//port address
//data variable
//output to parallel port
//input from parallel port
PC Monitor Port (common HD15 connector)
Pins
Description
1
Red
2
Green
3
Blue
4
reserved
5
reserved
6
Red return
7
Green return
8
Blue return
Computer Port Information
Port Range
Description
000-00F
DMA Chip 8737
020-021
8259 PIC
040-043
Timer Chip 8253
060-063
PPI 8255 (cassette, sound)
Pins
Description
9
Key (no pin)
10
Ground
11
Monitor sense 0
12
Monitor sense 1
13
Horizontal sync
14
Vertical sync
15
reserved
http://www.repairfaq.org/REPAIR/F_Pinouts1.html
Port Range
2F8-2FF
378-37F
3B0-3BF
3D0-3DF
Description
COM 2
Parallel Printer Port
Monochrome Display
Color display
080-083
200-20F
278-27F
DMA Page register’s
Game I/O Adapter
Reserved
3F0-3F7
3F8-3FF
Diskette
COM 1
Computer Interrupt Information
Bios INT
Dos INT
Function
no.
21h
21h
01h
08h
00h
01h
02h
21h
21h
02h
09h
00h
0Fh
02h
03h
0Ah
09h
08h
06h
21h
05h
00h
01h
02h
21h
21h
35h
25h
21h
21h
21h
48h
49h
4Ah
33h
33h
33h
33h
21h
00h
01h
02h
03h
31h
16h
16h
16h
10h
10h
10h
10h
10h
10h
10h
10h
17h
17h
17h
1Ch
Mouse INT
Mouse INT
Mouse INT
Mouse INT
13h
13h
13h
13h
00h
01h
02h
03h
21h
21h
21h
21h
21h
47h
3Bh
39h
3Ah
19h
21h
21h
21h
3Dh
3Fh
3Eh
21h
21h
3Ch
40h
21h
42h
21h
21h
21h
21h
21h
21h
21h
21h
21h
21h
21h
21h
21h
21h
21h
43h
56h
57h
1Ah
1Bh
1Ch
4Eh
41h
Description
Using Keyboard
Wait for keyboard input
Console input without echo
Read keyboard input
Read keyboard status
Return shift flag status
Controlling the video display
Display Output
Display string
Set video mode
Read current video mode
Set cursor position
Read current cursor position
Write character to screen
Write character/attribute to screen
Write character/attribute from screen
Scroll current page up
Controlling the Printer
Printer output
Print character
Initialize printer
Read printer status
Interrupt Handling (interrupt vector table)
Get interrupt vector
Set interrupt vector
Multitasking
Timer tick
Memory Management
Allocate memory
Free allocated memory
Modify allocate memory blocks
Using the Mouse
Mouse reset and status
Show mouse cursor
Hide mouse cursor
Get button status and mouse position
Terminate and stay resident
Reading and Writing Disk Sectors
Reset diskette system
Read diskette status
Read diskette sector
Write diskette sector
Directory Functions
Get current directory
Set current directory
Create sub-directory
Delete sub-directory
Get current drive
Reading Text Files
Open file with handle
Read from file
Close file with handle
Creating a Text File
Create file
Write to file
Accessing an Existing File
Position file pointer
Miscellaneous File and Disk Functions
Get or set file attributes
Rename file
Get or set file date and time
Set disk transfer area (DTA)
Get current drive information
Get drive information
Find file
Delete file