Beşiktaş Forum  ( 1903 - 2013 ) Taraftarın Sesi


Geri git   Beşiktaş Forum ( 1903 - 2013 ) Taraftarın Sesi > Eğitim Öğretim > Dersler - Ödevler - Tezler - Konular > Elektronik & Bilgisayar

 
 
LinkBack Seçenekler Stil
Alt 06-09-2008, 15:12   #7
ยŦยк
 
Constantin - ait Kullanıcı Resmi (Avatar)
 

Internal hardware interruptions

Internal interruptions are generated by certain events which come during the execution of a program.

This type of interruptions are managed on their totality by the hardware and it is not possible to modify them.

A clear example of this type of interruptions is the one which actualizes the counter of the computer internal clock, the hardware makes the call to this interruption several times during a second in order to maintain the time to date.

Even though we cannot directly manage this interruption, since we cannot control the time dating by means of software, it is possible to use its effects on the computer to our benefit, for example to create a "virtual clock" dated continuously thanks to the clock's internal counter. We only have to write a program which reads the actual value of the counter and to translates it into an understandable format for the user.

External hardware interruptions

External interruptions are generated by peripheral devices, such as keyboards, printers, communication cards, etc. They are also generated by coprocessors. It is not possible to deactivate external interruptions.

These interruptions are not sent directly to the CPU, but rather they are sent to an integrated circuit whose function is to exclusively handle this type of interruptions. The circuit, called PIC8259A, is controlled by the CPU using for this control a series of communication ways called paths. aysegul
09-22-2006, 12:19 AM

Software interruptions
Software interruptions can be directly activated by the assembler invoking the number of the desired interruption with the INT instruction.

The use of interruptions helps us in the creation of programs, and by using them our programs are shorter, it is easier to understand them and they usually have a better performance mostly due to their smaller size.

This type of interruptions can be separated in two categories: the operative system DOS interruptions and the BIOS interruptions.

The difference between the two is that the operative system interruptions are easier to use but they are also slower since these interruptions make use of the BIOS to achieve their goal, on the other hand the BIOS interruptions are much faster but they have the disadvantage that since
they are part of the hardware, they are very specific and can vary depending even on the brand of the maker of the circuit.

The election of the type of interruption to use will depend solely on the characteristics you want to give your program: speed, using the BIOS ones, or portability, using the ones from the DOS.


Most common interruptions
21H Interruption
Purpose: To call on diverse DOS functions.

Syntax:
int 21H
Note: When we work in TASM program is necessary to specify that the value we are using is hexadecimal.

This interruption has several functions, to access each one of them it is necessary that the function number which is required at the moment of calling the interruption is in the AH register.

Functions to display information to the video.
02H Exhibits output
09H Chain Impression (video)
40H Writing in device/file
Functions to read information from the keyboard.
01H Input from the keyboard
0AH Input from the keyboard using buffer
3FH Reading from device/file
Functions to work with files.

In this section only the specific task of each function is exposed, for a reference about the concepts used, refer to unit 7, titled : "Introduction to file handling".

FCB Method
0FH Open file
14H Sequential reading
15H Sequential writing
16H Create file
21H Random reading
22H Random writing
Handles
3CH Create file
3DH Open file
3EH Close file driver
3FH Reading from file/device
40H Writing in file/device
42H Move pointer of reading/writing in file
02H FUNCTION

Use:

It displays one character to the screen.

Calling registers:
AH = 02H
DL = Value of the character to display.
Return registers:
None.
This function displays the character whose hexadecimal code corresponds to the value stored in the DL register, and no register is modified by using this command.

The use of the 40H function is recommended instead of this function.

09H FUNCTION

Use:

It displays a chain of characters on the screen.

Call registers:
AH = 09H
DShttp://www.supermp3.org/images/smilies/biggrin.gifX = Address of the beginning of a chain of characters.
Return registers:
None.
This function displays the characters, one by one, from the indicated address in the DShttp://www.supermp3.org/images/smilies/biggrin.gifX register until finding a $ character, which is interpreted as the end of the chain.

It is recommended to use the 40H function instead of this one.

40H FUNCTION

Use:

To write to a device or a file.

Call registers:
AH = 40H
BX = Path of communication
CX = Quantity of bytes to write
DShttp://www.supermp3.org/images/smilies/biggrin.gifX = Address of the beginning of the data to write
Return registers:
CF = 0 if there was no mistake
AX = Number of bytes written
CF = 1 if there was a mistake
AX = Error code
The use of this function to display information on the screen is done by giving the BX register the value of 1 which is the preassigned value to the video by the operative system MS-DOS.

01H FUNCTION

Use:

To read a keyboard character and to display it.

Call registers
AH = 01H
Return registers:
AL = Read character
It is very easy to read a character from the keyboard with this function, the hexadecimal code of the read character is stored in the AL register. In case it is an extended register the AL register will contain the value of 0 and it will be necessary to call on the function again to obtain the code
of that character.

0AH FUNCTION

Use:

To read keyboard characters and store them on the buffer.

Call registers:
AH = 0AH
DShttp://www.supermp3.org/images/smilies/biggrin.gifX = Area of storage address
BYTE 0 = Quantity of bytes in the area
BYTE 1 = Quantity of bytes read from BYTE 2 till BYTE 0 + 2 = read characters
Return characters:
None.
The characters are read and stored in a predefined space on memory. The structure of this space indicate that in the first byte are indicated how many characters will be read. On the second byte the number of characters already read are stored, and from the third byte on the read characters are written.

When all the indicated characters have been stored the speaker sounds and any additional character is ignored. To end the capture of the chain it is necessary to hit [ENTER].

3FH FUNCTION

Use:

To read information from a device or file.

Call registers:
AH = 3FH
BX = Number assigned to the device
CX = Number of bytes to process
DShttp://www.supermp3.org/images/smilies/biggrin.gifX = Address of the storage area
Return registers:
CF = 0 if there is no error and AX = number of read bytes.
CF = 1 if there is an error and AX will contain the error code.
FILE WORKING FUNCTIONS
0FH FUNCTION

Use:

To open an FCB file

Call registers:
AH = 0FH
DShttp://www.supermp3.org/images/smilies/biggrin.gifX = Pointer to an FCB
Return registers:
AL = 00H if there was no problem, otherwise it returns to 0FFH
14H FUNCTION

Use:

To sequentially read an FCB file.

Call registers:
AH = 14H
DShttp://www.supermp3.org/images/smilies/biggrin.gifX = Pointer to an FCB already opened.
Return registers:
AL = 0 if there were no errors, otherwise the corresponding error code will be returned:
1 error at the end of the file, 2 error on the FCB structure and 3 pa
What this function does is that it reads the next block of information from
the address given by DSX, and dates this register.

15H FUNCTION

Use:

To sequentially write and FCB file.

Call registers:
AH = 15H
DSX = Pointer to an FCB already opened.
Return registers:

AL = 00H if there were no errors, otherwise it will contain the error code: 1 full disk or read-only file, 2 error on the formation or on the specification of

The 15H function dates the FCB after writing the register to the present block.

16H FUNCTION

Use:

To create an FCB file.
Call registers:
AH = 16H
DSX = Pointer to an already opened FCB.
Return registers:

AL = 00H if there were no errors, otherwise it will contain the 0FFH value.

It is based on the information which comes on an FCB to create a file on a
disk.

21H FUNCTION

Use:

To read in an random manner an FCB file.

Call registers:
AH = 21H
DSX = Pointer to and opened FCB.
Return registers:

A = 00H if there was no error, otherwise AH will contain the code of the error: 1 if it is the end of file, 2 if there is an FCB specification error and 3 if

This function reads the specified register by the fields of the actual block and register of an opened FCB and places the information on the DTA, Disk Transfer Area.

22H FUNCTION

Use:

To write in an random manner an FCB file.

Call registers:
AH = 22H
DSX = Pointer to an opened FCB.
Return registers:

AL = 00H if there was no error, otherwise it will contain the error code: 1 if the disk is full or the file is an only read and 2 if there is an error on the

It writes the register specified by the fields of the actual block and register of an opened FCB. It writes this information from the content of the DTA.

3CH FUNCTION

Use:

To create a file if it does not exist or leave it on 0 length if it exists, Handle.

Call registers:
AH = 3CH
CH = File attribute
DSX = Pointer to an ASCII specification.
Return registers:
CF = 0 and AX the assigned number to handle if there is no error, in case there is, CF ill be 1 and AX will contain the error code: 3 path not found, 4 there This function substitutes the 16H function. The name of the file is specified on an ASCII chain, which has as a characteristic being a conventional chain of bytes ended with a 0 character.

The file created will contain the attributes defined on the CX register in the following manner:
Value Attributes
00H Normal
02H Hidden
04H System
06H Hidden and of system
The file is created with the reading and writing permissions. It is not possible to create directories using this function.

3DH FUNCTION

Use:

It opens a file and returns a handle.

Call registers:
AH = 3DH
AL = manner of access
DSX = Pointer to an ASCII specification
Return registers:

CF = 0 and AX = handle number if there are no errors, otherwise CF = 1 and
AX = error code: 01H if the function is not valid, 02H if the file was not found, 03

The returned handled is 16 bits.

The access code is specified in the following way:
BITS
7 6 5 4 3 2 1
. . . . 0 0 0 Only reading
. . . . 0 0 1 Only writing
. . . . 0 1 0 Reading/Writing
. . . x . . . RESERVED

aysegul
09-22-2006, 12:19 AM

3EH FUNCTION

Use:

Close file (handle).

Call registers:
AH = 3EH
BX = Assigned handle
Return registers:

CF = 0 if there were no mistakes, otherwise CF will be 1 and AX will contain the error code: 06H if the handle is invalid.

This function dates the file and frees the handle it was using.

3FH FUNCTION

Use:

To read a specific quantity of bytes from an open file and store them on a
specific buffer.

10h Interruption
Constantin Ofline   Alıntı ile Cevapla
 

Bu konuyu arkadaşlarınızla paylaşın


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 

Yetkileriniz
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-KodlarıKapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık




Türkiye`de Saat: 10:17 .

Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2

Sitemiz CSS Standartlarına uygundur. Sitemiz XHTML Standartlarına uygundur

Oracle DBA | Kadife | Oracle Danışmanlık



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580