home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
CEXPRESS.ZIP
/
BITS.ASM
/
POKE.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-05-03
|
611b
|
27 lines
;unsigned short poke(segment,offset,value);
; unsigned short segment,offset,value;
EXTRN _memory_model:byte
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _poke
_poke proc near
mov bx,sp ;set stack frame
cmp _memory_model,0 ;near or far?
jle begin ;jump if near
inc bx ;else add 2 to BX
inc bx ;
begin: mov ax,ss:[bx+2] ;get segment
mov es,ax ;
mov di,ss:[bx+4] ;get offset
mov ax,ss:[bx+6] ;get value
mov es:[di],ax ;set it
cmp _memory_model,0 ;quit
jle quit ;
db 0CBh ;RET far
quit: ret ;RET near
_poke endp
_TEXT ENDS
END