; Assembler emulator of future mcpu-cc PROGRAM output. ; ; It intentionally defines only main() and fini(); lifecycle symbols belong ; to CRT and must be inserted automatically by mcpu-ld. .global main .global fini .text main: ; Startup hooks must already have completed. LDI r64@0x70100, 2 ICMP r64@0x70000, r64@0x70100 JNZ .L_main_bad ; argc must include argv[0] plus the two test arguments. LDSP r64@0x70108, 8 LDI r64@0x70110, 3 ICMP r64@0x70108, r64@0x70110 JNZ .L_main_bad ; argv[argc] is the required NULL terminator. LDSP r64@0x70118, 16 PADDI r64@0x70120, r64@0x70118, 24 LOADP r64@0x70128, r64@0x70120 CLR r64@0x70130 ICMP r64@0x70128, r64@0x70130 JNZ .L_main_bad LDI r64@0x70000, 3 LDI r32@0x7fffc, 42 RET .L_main_bad: LDI r64@0x70000, 900 LDI r32@0x7fffc, 43 RET fini: LDI r64@0x70100, 3 ICMP r64@0x70000, r64@0x70100 JNZ .L_fini_bad LDI r64@0x70000, 4 RET .L_fini_bad: LDI r64@0x70000, 901 RET