1

I am trying to run a simple HLA (High Level Assembly) program on MacOS High Sierra Vesion 10.13.3. I am receiving a "Segmentation fault: 11" on the command line when simply trying to run the program.

./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 ;

This program seems to run fine on Windows but I really would like to be able to get it to work on Mac. Any help is greatly appreciated.

0 Answers0