// An input stream of characters is copied from standard input // to a stream of characters on standard output until the character // 'f' is encountered. .method newline // int newline() .define nl = 10 // { .define OBJREF = 44 bipush OBJREF bipush nl invokevirtual putchar // putchar(nl); ireturn // return nl; // } .method main // int main(){ .locals 1 // int c; .define c = 1 .define asciif = 102 .define OBJREF = 44 bipush OBJREF invokevirtual getchar istore c // c = getchar(); while: iload c // while ( c!='f') { bipush asciif isub ifeq end_while bipush OBJREF iload c invokevirtual putchar // putchar(c); pop // discard return value bipush OBJREF invokevirtual getchar istore c // c = getchar(); goto while // } end_while: bipush OBJREF invokevirtual newline // newline(); pop iload c ireturn // return c; // }