我正在尝试在 MacOS High Sierra Vesion 10.13.3 上运行一个简单的 HLA(高级装配)程序。尝试运行程序时,我在命令行上收到“分段错误:11”。
。/X
program x ;
#include ( "stdlib.hhf" )
#include ( "args.hhf" )
static
argCount : int32 ;
begin x ;
arg.c(); // call the procedure to fetch the command line args:
// (this will put the argument count in eax)
stdout.put( "Number of arguments: ", (type uns32 eax), nl );
// to process individual argments, put the number of command line args
// in the edx register.
// set up ecx to count the args displayed, compare with edx
mov( eax, edx );
// call arg.v(num of arg) to put string's addr in eax for display
for( mov( 0, ecx ); ecx < edx; inc( ecx )) do
arg.v(ecx);
stdout.put( "at address: ", eax, " " );
stdout.put( "arg[", (type uns32 ecx), "]= ", (type string eax), nl );
endfor;
end x ;
这个程序似乎在 Windows 上运行良好,但我真的希望能够让它在 Mac 上运行。任何帮助是极大的赞赏。