View Javadoc

1   /*
2    * $Id: MemoryReadAccess.java,v 1.3 2005/10/15 19:29:52 weiju Exp $
3    * 
4    * Created on 25.09.2005
5    * Copyright 2005 by Wei-ju Wu
6    *
7    * This file is part of The Z-machine Preservation Project (ZMPP).
8    *
9    * ZMPP is free software; you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as published by
11   * the Free Software Foundation; either version 2 of the License, or
12   * (at your option) any later version.
13   *
14   * ZMPP is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   *
19   * You should have received a copy of the GNU General Public License
20   * along with ZMPP; if not, write to the Free Software
21   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22   */
23  package org.zmpp.base;
24  
25  /***
26   * This interface defines an abstract read access to a region of memory.
27   *
28   * @author Wei-ju Wu
29   * @version 1.0
30   */
31  public interface MemoryReadAccess {
32  
33    /***
34     * Reads the unsigned 32 bit word at the specified address.
35     * 
36     * @param address the address
37     * @return the 32 bit unsigned value as long
38     */
39    long readUnsigned32(int address);
40    
41    /***
42     * Reads the unsigned 16 bit word at the specified address.
43     * 
44     * @param address the address
45     * @return the 16 bit unsigned value as int
46     */
47    int readUnsignedShort(int address);
48    
49    /***
50     * Returns the signed 16 bit word at the specified address.
51     * 
52     * @param address the address
53     * @return the 16 bit signed value
54     */
55    short readShort(int address);
56    
57    /***
58     * Returns the unsigned 8 bit value at the specified address.
59     * 
60     * @param address the address
61     * @return the 8 bit unsigned value
62     */
63    short readUnsignedByte(int address); 
64    
65    /***
66     * Returns the signed 8 bit value at specified address.
67     * 
68     * @param address the byte address
69     * @return the 8 bit signed value
70     */
71    byte readByte(int address);
72  }