1 / 11

Application of Computer Graphics and Animation Using C++ Language.

Application of Computer Graphics and Animation Using C++ Language. Contents. Interrupts & Registers & DMA & Pointers Plotting Pixel Line / Rectangle / Polygon Circle / Arc Ellipse Fill. Interrupt. It is a request generated by Processor for peripheral devices OR

connor
Download Presentation

Application of Computer Graphics and Animation Using C++ Language.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Application of Computer Graphics and Animation Using C++ Language.

  2. Contents • Interrupts & Registers & • DMA & Pointers • Plotting Pixel • Line / Rectangle / Polygon • Circle / Arc • Ellipse • Fill

  3. Interrupt It is a request generated by • Processor for peripheral devices OR • by peripheral devices for processor._____________________________________________ • Dos identifies these interrupts by interrupt No. & there are total 256 Interrupts under DOS • Windows call these interrupts as API’s. & there are unlimited API’s under Windows. _____________________________________________ Software Interrupts Software requests to hardware (21h). Hardware Interrupts Processor’s request to Hardware (0~6h) BIOS Interrupts Monitors, Keyboards other Basic Hardware.

  4. Generating an Interrupt The generation of an interrupt requires following things to take care. Interrupt No : To generate or call an interrupt we must first know what is its Interrupt No. Most common Interrupt No’s are as below.Timer: 8h Keyboard: 9h VGA: 10h Hard Disk: 13h DOS: 21h Mouse: 33h Service No:It is the no related to a function to be performed by that interrupted device. i.e. different VGA service no’s. Move Cursor: 2 Change Cursor:1 Get Cursor: 3

  5. Registers • Scratch Pads • General Purpose • Temporary data storage • Calculation Purpose • Built in Processor • Address registers • Flags • Parameters & Returns of Interrupts

  6. Interrupts & Registers • The Parameters of an interrupt called are passed through general purpose registers. • AX, BX, CX, DX • 2Byte Structure • AH-AL, BH-BL, CH-CL, DH-DL • Each sharing 1 byte from a register • The Data storing and retrieving is dependent AH 8 Bits AL 8 Bits AX 16 Bits Register

  7. Using Registers in C++ • Data Structure like Registers • “struct” and “union” • “struct” is group of data sturtures • “union” is “struct”, and it shares mem • Register’s structure is composed of a Union and two structures

  8. REGS • union REGS { struct WORDREGS x; struct BYTEREGS h; }; • struct BYTEREGS { unsigned char al, ah, bl, bh; unsigned char cl, ch, dl, dh; }; • struct WORDREGS { unsigned int ax, bx, cx, dx; unsigned int si, di, cflag, flags; }; REGS.h.ah (8 Bits) REGS.h.al REGS.x.ax 16 Bits

  9. Calling Interrupt • Int86(int intno, union REGS *inregs, union REGS *outregs); • Copies the Register Values from REGS Union to Registers • Calls the interrupt • Copies the Register Values from Registers to Union

  10. Rules • Better to use Hexadecimal No as interrupt no/ service no. • The Service no is placed in ah register always • Other registers are used as parameter registers • After the calling these registers are used as return registers.

  11. DMA & Pointers • Memory is directly Accessed • Specific Solution • Difficult • Fast • Pointers Used • More Technical / Mathematical

More Related