home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / bp_6_93 / bonus / winer / peekpoke.asm < prev    next >
Assembly Source File  |  1992-05-12  |  610b  |  28 lines

  1. ;PEEKPOKE.ASM, simplifies access to full words
  2.  
  3. ;Copyright (c) 1991 Ethan Winer
  4.  
  5.  
  6. .Model Medium, Basic
  7. .Code
  8.  
  9. PeekWord Proc Uses ES, SegAddr:DWord
  10.  
  11.     Les  BX,SegAddr     ;load the segment and address
  12.     Mov  AX,ES:[BX]     ;read the word into AX
  13.     Ret                 ;return to BASIC
  14.  
  15. PeekWord Endp
  16.  
  17.  
  18.  
  19. PokeWord Proc Uses ES, SegAddr:DWord, Value:Word
  20.  
  21.     Les  BX,SegAddr     ;load the segment and address
  22.     Mov  AX,Value       ;and the new value to store there
  23.     Mov  ES:[BX],AX     ;write the value into memory
  24.     Ret                 ;return to BASIC
  25.  
  26. PokeWord Endp
  27. End
  28.