HW08-JRollinson/CodeWriter.java
private String popTemplate(String fragment, int index, boolean isDirect)
    {
        String noPointerCode = (isDirect)? "D=A\n" : "D=M\n@" + index + "\nD=D+A\n";

        return "@" + fragment + "\n" + noPointerCode + "@R13\n" + "M=D\n" + "@SP\n" +
                "AM=M-1\n" + "D=M\n" + "@R13\n" + "A=M\n" + "M=D\n";
    }
//						When it is a static R13 will store the index address.

When it is a static R13 will store the index address.
When it is a static R13 will store the index address .
private String popTemplate(String fragment, int index, boolean isDirect)
    {
        String noPointerCode = (isDirect)? "D=A\n" : "D=M\n@" + index + "\nD=D+A\n";
        return "@" + fragment + "\n" + noPointerCode + "@R13\n" + "M=D\n" + "@SP\n" +
                "AM=M-1\n" + "D=M\n" + "@R13\n" + "A=M\n" + "M=D\n";
    }
private String popTemplate ( String fragment , int index , boolean isDirect ) { String noPointerCode = ( isDirect ) ? "D=A\n" : "D=M\n@" + index + "\nD=D+A\n" ; return "@" + fragment + "\n" + noPointerCode + "@R13\n" + "M=D\n" + "@SP\n" + "AM=M-1\n" + "D=M\n" + "@R13\n" + "A=M\n" + "M=D\n" ; }
When it is a static R13 will store the index address.
When it is a static R13 will store the index address .