home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
msdos
/
c
/
jazlib.arc
/
MEML.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-06-19
|
1KB
|
54 lines
Comment *
┌────────────────────────────────────────────────────────────────────────────┐
│meml.asm │
│Look at a long of memory, pass it back to c as the function result. │
│ │
│Synopsis: w = meml(0x40,0x17); │
└────────────────────────────────────────────────────────────────────────────┘
*
;=============================================================================
; Data
;=============================================================================
DGROUP group _DATA
_DATA segment word public 'DATA'
assume ds:DGROUP
; Your Data goes here . . .
_DATA ends
;=============================================================================
; Code
;=============================================================================
assume cs:_text
_text segment public byte 'code'
PUBLIC _meml
_meml proc near
push bp ; save base of stack
mov bp,sp ; establish stack frame
push ds ; save data and extra segs
push si
push [bp+4] ; get segment address
pop ds
mov si,[bp+6] ; get offset address
mov ax,[si] ; get byte in return parameter
mov bx,[si+2]
pop si
pop ds ; restore data and extra segs
mov sp,bp ; restore stack pointer
pop bp ; and base of stack
ret ; return to caller
_meml endp
_text ends
end