Chapter 7

Tables


ASCII Chart.............................................. 188

Key Codes............................................... 190

MS-DOS Program Segment Prefix (PSP)......................... 192

Color Display Attributes..................................... 193

Hexadecimal-Binary-Decimal Conversion.......................... 194

 

ASCII Codes

   

 

   

 

Key Codes

   

 

   

MS-DOS Program Segment Prefix (PSP)

   

  1 Opcode for INT 20h instruction (CDh 20h)

  2 Segment of first allocatable address following the program (used for memory allocation)

  3 Reserved or used by MS-DOS

  4 Opcode for far call to MS-DOS function dispatcher

  5 Vector for terminate routine

  6 Vector for CTRL+C handler routine

  7 Vector for error handler routine

  8 Segment address of program’s environment block

  9 Opcode for MS-DOS INT 21h and far return (you can do a far call to this address to execute
  MS-DOS calls)

10 First command-line argument (formatted as uppercase 11-character filename)

11 Second command-line argument (formatted as uppercase 11-character filename)

12 Number of bytes in command-line argument

13 Unformatted command line and/or default Disk Transfer Area (DTA)

 

Color Display Attributes

Background

Foreground

Bits

Num

Color

Bits*

Num

Color

F

R

G

B

I

R

G

B

0

0

0

0

0

Black

0

0

0

0

0

Black

0

0

0

1

1

Blue

0

0

0

1

1

Blue

0

0

1

0

2

Green

0

0

1

0

2

Green

0

0

1

1

3

Cyan

0

0

1

1

3

Cyan

0

1

0

0

4

Red

0

1

0

0

4

Red

0

1

0

1

5

Magenta

0

1

0

1

5

Magenta

0

1

1

0

6

Brown

0

1

1

0

6

Brown

0

1

1

1

7

White

0

1

1

1

7

White

1

0

0

0

8

Black blink

1

0

0

0

8

Dark gray

1

0

0

1

9

Blue blink

1

0

0

1

9

Light Blue

1

0

1

0

A

Green blink

1

0

1

0

A

Light green

1

0

1

1

B

Cyan blink

1

0

1

1

B

Light cyan

1

1

0

0

C

Red blink

1

1

0

0

C

Light red

1

1

0

1

D

Magenta blink

1

1

0

1

D

Light Magenta

1

1

1

0

E

Brown blink

1

1

1

0

E

Yellow

1

1

1

1

F

White blink

1

1

1

1

F

Bright White

 

F   Flashing bit                 G   Green bit    I     Intensity bit

R   Red bit                        B   Blue bit

* On monochrome monitors, the blue bit is set and the red and green bits are cleared (001) for underline; all color bits are set (111) for normal text.

 

Hexadecimal-Binary-Decimal Conversion

Hex
Number

Binary Number

Decimal Digit 000X

Decimal Digit 00X0

Decimal Digit 0X00

Decimal Digit X000

0

0000

0

0

0

0

1

0001

1

16

256

4,096

2

0010

2

32

512

8,192

3

0011

3

48

768

12,288

4

0100

4

64

1,024

16,384

5

0101

5

80

1,280

20,480

6

0110

6

96

1,536

24,576

7

0111

7

112

1,792

28,672

8

1000

8

128

2,048

32,768

9

1001

9

144

2,304

36,864

A

1010

10

160

2,560

40,960

B

1011

11

176

2,816

45,056

C

1100

12

192

3,072

49,152

D

1101

13

208

3,328

53,248

E

1110

14

224

3,584

57,344

F

1111

15

240

3,840

61,440