⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhalf.java

📁 用Java实现的编译器。把源代码编译成SPARC汇编程序
💻 JAVA
字号:
// $Id: dHalf.java,v 1.3 2000/10/21 23:18:13 mdeeds Exp $package java6035.tools.ASM;/** * dHalf * * represents an .half directive in ASM file. ".half h1, ..., hn" stores * the n 16-bit quantities in successive memory words. Each value must fit  * into the 16 bit width */public class dHalf extends ASMDirective{    protected Object[] entries;    /**     * constructs a dHalf object of the size given. Elements are     * initialized to 0, and will be filled in later.     */    public dHalf(int size)    {		super(ASMDirective.HALF);		this.entries = new Object[size];		for(int i=0; i<size; i++) {		    this.entries[i] = new Long(0);		}    }    /**     * Returns the nth element of the dHalf object.     */    public Object elementAt(int n)    {		return this.entries[n];    }    /**     * Replaces the @param n th element of the dHalf object with new     * value, @param s.  @param n = 0 specifies the first element.     **/    public void setElementAt(int n, String s)    {		this.entries[n] = s;    }        /**     * Replaces the @param n th element of the dHalf object with new     * value, @param l.  @param n = 0 specifies the first element.       **/    public void setElementAt(int n, Long l)    {		this.entries[n] = l;    }    /**     * Returns the string representation.     */    public String toString()    {		String s = ".word ";		int length = entries.length;			if (length == 0) return "";			s += entries[0].toString();			for(int i=1; i<length; i++) 		{		   s += ","+entries[i].toString();		}			return s;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -