home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / mouse / lib / ega / examples / f4examp.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.1 KB  |  36 lines

  1. ; The following example saves the contents of the Miscellaneous Output
  2. ; register, Sequencer Memory Mode register, and CRT Controller Mode Control
  3. ; register in "results".
  4.  
  5. outvals    dw    0020h        ; miscellaneous output register
  6.     db    0        ; 0 for single registers
  7.     db    ?        ; returned value
  8.  
  9.     dw    0008h        ; sequencer
  10.     db    04h        ; memory mode register index
  11.     db    ?        ; returned value
  12.  
  13.     dw    0000h        ; crt controller
  14.     db    17h        ; mode control register index
  15.     db    ?        ; returned value
  16.  
  17. results    db    3 dup (?)
  18.  
  19.     mov    ax, ds            ; assume outvals in data segment
  20.     mov    es, ax            ; es = data segment
  21.     mov    bx, offset outvals    ; es:bx = outvals address
  22.     mov    ah, 0f4h        ; f4 = read register set
  23.     mov    cx, 3            ; number of entries in outvals
  24.     int    10h            ; get values into outvals!
  25.     mov    si, 3            ; move the returned values from
  26.     add    si, offset outvals    ;  outvals
  27.     mov    di, offset results    ;  to results
  28.     mov    cx, 3            ; 3 values to move
  29.  
  30. movloop:
  31.     mov    ax, [si]        ; move one value from outvals
  32.     mov    [di], ax        ;  to results
  33.     add    si, 4            ; skip to next source byte
  34.     inc    di            ; point to next destination byte
  35.     loop    movloop
  36.