OpenVMS Source Code Demos
PEEK_BYTE_VAX.MAR
;--------------------------------------------------------------------------------
; Title : Peek_byte_vax.mar
; Author : Neil S. Rieck (Waterloo, Ontario, Canada)
; Created: 1999.11.12
;
; Notes:
; 1. This VAX assembly language function peeks (byte wise) into a memory location
; 2. It is tested for use with VAX-BASIC (see peek_demo1.bas)
; 3. parameters are passed here via register ap (argument pointer) a.k.a. r12
; 4. results are returned via r0 (and sometimes r1)
;--------------------------------------------------------------------------------
.entry peek_byte_vax,^M<> ; function name is PEEK_BYTE_VAX (null entry mask)
clrq r0 ; clear both r0 + r1 (cuz q = 64 bit)
movl @4(ap),r2 ; passed parameter #1 is address of data
movb (r2),r0 ; do an indirect byte fetch into r0
ret ; return to calling program
.end
Back to
Home
Neil Rieck
Waterloo, Ontario, Canada.