home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PASCUTIL.ZIP / POKESUB.ASM < prev   
Encoding:
Assembly Source File  |  1985-11-07  |  896 b   |  27 lines

  1. ; POKESUB - subroutine to write memory for Pascal programs
  2. ; POKESUB(DATASEG,LOCATION,POKEVAL)
  3. ; DATASEG is the value of the data segment
  4. ; LOCATION is the memory location relative to the DS (0-66535)
  5. ; POKEVAL is the integer value (0-255) to be written
  6. cseg segment para public 'code'
  7. public pokesub
  8. pokesub proc far
  9.     assume cs:cseg,ds:nothing,ss:nothing,es:nothing
  10.     push bp
  11.     mov bp,sp
  12.     push es         ; save original es
  13.     mov si,[bp+10]   ; point to dataseg
  14.     mov ax,[si]      ; dataseg in ax
  15.     mov es,ax         ; fix extra segment
  16.     mov di,[bp+8]    ; point to memory location
  17.     mov di,[di]      ; location in di
  18.     mov si,[bp+6]    ; point to return value
  19.     mov ax,[si]      ; value in al
  20.     mov es:[di],al   ; poke
  21.     pop es         ; restore es
  22.     pop bp
  23.     ret 6
  24. pokesub endp
  25. cseg ends
  26.     end
  27.