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

📄 dbyte.java

📁 用Java实现的编译器。把源代码编译成SPARC汇编程序
💻 JAVA
字号:
// $Id: dByte.java,v 1.3 2000/10/21 23:18:13 mdeeds Exp $package java6035.tools.ASM;/** * dByte * * represents an .byte directive in ASM file. ".byte b1, ..., bn" stores * the n 8-bit quantities in successive memory words. each value must  * fit into the 8 bit range. */public class dByte extends ASMDirective{											    protected Object[] entries;    /**     * constructs a dByte object of the size given. Elements are     * initialized to 0, and will be filled in later.     */    public dByte(int size)    {		super(ASMDirective.BYTE);		this.entries = new Object[size];		for(int i=0; i<size; i++) {		    this.entries[i] = new Long(0);		}    }    /**     * Returns the nth element of the dByte object.     */    public Object elementAt(int n)    {		return this.entries[n];    }    /**     * Replaces the @param n th element of the dByte 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 dByte 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 + -