Microprocessors Interrupts

Embed Size (px)

Citation preview

  • 8/9/2019 Microprocessors Interrupts

    1/6

    INT 10h  / AH = 0 - set video mode.

    input:

    AL = desired video mode.

    these video modes are supported:

    00h - text mode. 40x25. 16 colors. 8 pages.

    03h - text mode. 80x25. 16 colors. 8 pages.

    13h - graphical mode. 40x25. 256 colors. 320x200 pixels. 1 page.

    example:

      mov al, 13h  mov ah, 0  int 10h

     

    INT 10h  / AH = 2 - set cursor positio.input:

    DH = ro!.DL = colum.

    BH = page um"er #0..$%.

    example:

      mov dh, 10  mov dl, 20  mov bh, 0  mov ah, 2  int 10h

     

    INT 10h  / AH = 03h - get cursor positio ad si&e.input:

    BH = page um"er.return:

    DH = ro!.DL = colum.CH = cursor start lie.CL = cursor "ottom lie.

  • 8/9/2019 Microprocessors Interrupts

    2/6

     

    INT 10h  / AH = 05h - select active video page.

    input:

    AL = e! page um"er #0..$%.the activated page is displa'ed.

    INT 10h  / AH = 08h - read character ad attri"ute at cursorpositio.input:

    BH = page um"er.

    return:

    AH = attribute.AL = character.

     

    INT 10h  / AH = 09h - !rite character ad attri"ute at cursorpositio.

    input:

    AL = character to displa'.

    BH = page um"er.BL = attribute.

    CX = um"er o( times to !rite character.

     

    INT 10h  / AH = 0Ah - !rite character ol' at cursor positio.

    input:

    AL = character to displa'.BH = page um"er.CX = um"er o( times to !rite character.

    INT 10h  / AH = 0Ch - chage color (or a sigle pixel.input:

    AL = pixel colorCX = colum.

    DX = ro!.

    example:

  • 8/9/2019 Microprocessors Interrupts

    3/6

      mov al, 13h  mov ah, 0  int 10h ; set graphics video mode.

    mov al, 1100b  mov cx, 10  mov dx, 20  mov ah, 0ch  int 10h ; set pixel.

    INT 10h  / AH = 0Dh - get color o( a sigle pixel.

    input:

    CX = colum.

    DX = ro!.

    output:AL = pixel color

     

    INT 10h  / AH = 13h - !rite strig.input:

    AL = !rite mode:  bit 0: update cursor a(ter !ritig)

      bit 1: strig cotais attributes.BH = page um"er.BL = attribute i( strig cotais ol' characters #"it 1 o( *+ is &ero%.CX = um"er o( characters i strig #attri"utes are ot couted%.

    DL,DH = colum, ro! at !hich to start !ritig.ES:BP poits to strig to "e prited.

    example:

      mov al, 1  mov bh, 0  mov bl, 0011_1011b  mov cx, msg1end - offset msg1 ; calculate message size.

    mov dl, 10  mov dh,   push cs  pop es  mov bp, offset msg1  mov ah, 13h  int 10h  !mp msg1end  msg1 db " hello, #orld$ "

      msg1end%

     INT 21h  / AH=1 - read character (rom stadard iput, !ith

  • 8/9/2019 Microprocessors Interrupts

    4/6

    echo, result is stored i AL.

    i( there is o character i the e'"oard "u((er, the (uctio !aitsutil a' e' is pressed.

    example:

      mov ah, 1  int 21h

     

    INT 21h  / AH=2 - !rite character to stadard output.

    etr': DL = character to !rite, a(ter executio AL = DL.

    example:

      mov ah, 2  mov dl, &a&

      int 21h

    INT 21h  / AH=7 - character iput !ithout echo to *+.i( there is o character i the e'"oard "u((er, the (uctio !aitsutil a' e' is pressed.

    example:

      mov ah,   int 21h

     

    INT 21h  / AH=9 - output o( a strig at DS:DX. trig must "etermiated "' $.

    example:

      org 100h  mov dx, offset msg  mov ah, '  int 21h

      ret  msg db "hello #orld ("

  • 8/9/2019 Microprocessors Interrupts

    5/6

     

    INT 21h  / AH=0Ah - iput o( a strig to DS:DX, (ist "'te is "u((er

    si&e, secod "'te is um"er o( chars actuall' read. this (uctiodoes nt add i the ed o( strig. to prit usig INT

    21h  / AH=9 'ou must set dollar character at the ed o( it ad startpritig (rom address DS:DX ! 2.

    example:

      org 100h  mov dx, offset buffer  mov ah, 0ah

      int 21h  !mp print  buffer db 10,), 10 dup*& &+  print%  xor bx, bx  mov bl, buffer1  mov bufferbx2, &(&  mov dx, offset buffer  2  mov ah, '  int 21h  ret

    the (uctio does ot allo! to eter more characters tha the

    speci(ied "u((er si&e.see also int21"#% i c:emu8086examples

    INT 21h  / AH=0Bh - get iput status)returs: AL = 00h i( o character availa"le, AL = 0&&h i( character

    is availa"le.

    INT 21h  / AH=2Ah - get s'stem date)retur: CX = 'ear #180-20%. DH = moth. DL = da'. AL = da'o( !ee #00h=uda'%

  • 8/9/2019 Microprocessors Interrupts

    6/6

    INT 21h  / AH=2Ch - get s'stem time)

    retur: CH = hour. CL = miute. DH = secod. DL = 1/100secods.

    INT 1'h  / AH = 00h - get e'stroe (rom e'"oard #o echo%.return:

    AH = sca code.

    AL = * character.#i( a e'stroe is preset, it is removed (rom the

    e'"oard "u((er%.

    INT 1Ah  / AH = 00h - get s'stem time.return:

    CX:DX = um"er o( cloc tics sice midight.

    AL = midight couter, advaced each timemidight passes.

    otes:

    there are approximatel' 18"20'(8 cloc tics per secod,ad 1800B0h per 24 hours.

    AL is ot set "' the emulator.

    INT 33h  / AX=0001 - sho! mouse poiter.

    example:

    mov ax, 1int 33h