📄 dascii.java
字号:
// $Id: dAsciiz.java,v 1.5 2000/10/21 23:18:10 mdeeds Exp $package java6035.tools.ASM;/** * dAsciiz * * represents an .asciiz directive in ASM file. ".ascii str" stores the * string in memory as a sequence of bytes without the terminating null character */public class dAscii extends ASMDirective{ public String str; /** * Create a new ASCII string directive. * @param str is the string to represent. **/ public dAscii(String str) { super(ASMDirective.ASCII); this.str = str; } /** * Quotes the string in a way that can be understood by other tools. * Turns quotes into \", backslashes into \\, and newlines into \n. */ public static String quotify(String str) { String out = ""; int i; for (i = 0; i < str.length(); i++) { if (str.charAt(i) == '\\') out += "\\\\"; else if (str.charAt(i) == '\"') out += "\\\""; else if (str.charAt(i) == '\n') out += "\\n"; else out += str.charAt(i); } return out; } /** * Returns the string representation. Special characters in the string * are replaced with their backslash-quoted representation. */ public String toString() { return ".ascii \""+quotify(str)+"\""; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -