home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
CEXPRESS.ZIP
/
BITS.ASM
/
POKEB.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-05-03
|
626b
|
28 lines
;unsigned short pokeb(segment,offset,value);
; unsigned short segment,offset;
; char value;
EXTRN _memory_model:byte
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _pokeb
_pokeb 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 al,ss:[bx+6] ;get value
mov es:[di],al ;set it
cmp _memory_model,0 ;quit
jle quit ;
db 0CBh ;RET far
quit: ret ;RET near
_pokeb endp
_TEXT ENDS
END