Let's start with the good old traditional Hello World application. Now, it turns out that writting a simple assembly language program for the ZX81 that just displays Hello World requires a fair amount of work,.
Originally, creating a machine code program on the ZX81 meant writing a 'hex loader' - an application into which you to typed the hex values of the machine code instructions you needed.
This hex loader would write these values in to a REM statement (which you had to have already created) then you would call into this block of machine code using the RAND USR command
We can bypass all of that by creating standard include files that generate a BASIC program with that REM statement, we then add in whatever code we want and finally include a couple more files to create the second line and also close out the BASIC program.
As with all 'Hello World's - this is meant as an example or template, the source is available on github and the .p file can be downloaded from here
The source code of the main file (hello.asm) is listed here