📄 dasciz.java
字号:
// $Id: dAsciiz.java,v 1.5 2000/10/21 23:18:10 mdeeds Exp $package java6035.tools.ASM;/** * dAsciz * * represents an .asciz directive in ASM file. ".asciz str" stores the * string in memory and null terminate it. */public class dAsciz extends ASMDirective{ public String str; /** * Create a new ASCIZ string directive. (0 terminated string.) * @param str is the string to represent. **/ public dAsciz(String str) { super(ASMDirective.ASCIZ); 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) == '\\') { if(str.charAt(i+1) != 'n') out += ""; else 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 ".asciz \""+quotify(str)+"\""; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -