if (optind < argc) { printf("Non-option ARGV-elements: "); while (optind < argc) printf("%s ", argv[optind++]); printf("\n"); }
exit(EXIT_SUCCESS); }
执行后会发现:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
ffo@debian:~/Cprogramme$ ./a.out -a Option a ffo@debian:~/Cprogramme$ ./a.out -f "12121" Option f with argument '12121' ffo@debian:~/Cprogramme$ ./a.out -add Option a Option d with argument 'd' ffo@debian:~/Cprogramme$ ./a.out --add ./a.out: option '--add' requires an argument ffo@debian:~/Cprogramme$ ./a.out --add "12121" Option a ffo@debian:~/Cprogramme$ ./a.out --verbose Option v ffo@debian:~/Cprogramme$
* TODO: Re-organize the `CPU_state' structure to match the register │ * encoding scheme in i386 instruction format. For example, if we │ * access cpu.gpr[3]._16, we will get the `bx' register; if we access │ * cpu.gpr[1]._8[1], we will get the 'ch' register. Hint: Use `union'. │ * For more details about the register encoding scheme, see i386 manual. │ */
/* Do NOT change the order of the GPRs' definitions. */
/* In NEMU, rtlreg_t is exactly uint32_t. This makes RTL instructions in PA2 able to directly access these registers. */ rtlreg_t eax, ecx, edx, ebx, esp, ebp, esi, edi;