#include <perms.h>
// Edinburgh IMP77 Compiler - Version 8.4
//
// 1 %begin
int main(int argc, char **argv) { /*%begin*/
_imp_enter(main);
_imp_initialise(argc, argv);
// 2
// 3 %routine pass3(%integerarray(3)%name param3)
void PASS3(_imp_dv PARAM3_dv) {
_imp_enter(PASS3);
// 4 %integer i = param3(5,16,17)
int I = 0xFEFEFEFE;
I = _imp_aref(int, PARAM3, /* Dim 1: */ 17);
// 5 %end
_imp_return;
_imp_begin_backtrace(PASS3);
_imp_diagf("\n\nArguments:\n\n");
_imp_diagf("\nLocal Variables:\n\n");
_imp_bt_int(I);
_imp_end_backtrace();
} /* end of PASS3 */
// ?I unused
// 6
// 7 ! If there is any declaration below (scalar or routine) the access
// 8 ! to param3 above shows dims=0 and the call translates wrongly.
// 9 ! However other statements such as a label or %stop do not have
// 10 ! this effect so implies an interaction with DEF in stack.c ???
// 11
// 12 %integer i
int I = 0xFEFEFEFE;
// 13
// 14 %endofprogram
_imp_stop(0);
end_0:;
_imp_begin_backtrace(main);
_imp_diagf("\n\nArguments:\n\n");
_imp_diagf("ARGC = %d\n", argc);
_imp_diagf("ARGV @[%p]\n", argv);
for (int i = 0; i < argc; i++) {
_imp_diagf(" ARGV(%d) = \"%s\"\n", i, argv[i]);
}
if (argv[argc] == 0) {
_imp_diagf(" ARGV(%d) = NULL\n", argc);
} else {
_imp_diagf(" ARGV(%d) = \"%s\"\n", argc, argv[argc]);
}
_imp_diagf("\nLocal Variables:\n\n");
_imp_bt_int(I);
_imp_end_backtrace();
_imp_stop(0);
}