home *** CD-ROM | disk | FTP | other *** search
/ Graphics Programming Black Book (Special Edition) / BlackBook.bin / disk1 / zenasmlg / zen_list.exe / LST10-17.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  487b  |  25 lines

  1. ;
  2. ; *** Listing 10-17 ***
  3. ;
  4. ; Reads a single byte stored in a far segment by
  5. ; temporarily pointing DS to the far segment.
  6. ;
  7.     jmp    Skip
  8. ;
  9. FarSeg    segment    para
  10. MemVar    db    0    ;this variable resides in a
  11.             ; far segment
  12. FarSeg    ends
  13. ;
  14. Skip:
  15.     call    ZTimerOn
  16.     rept    100
  17.     push    ds    ;preserve the normal data segment
  18.     mov    si,seg MemVar
  19.     mov    ds,si
  20.     mov    si,offset MemVar ;point DS:SI to MemVar
  21.     lodsb        ;read MemVar
  22.     pop    ds    ;retrieve the normal data segment
  23.     endm
  24.     call    ZTimerOff
  25.