This is an obsolete way to do that. In UEFI you don't need to play with assembly, look:
https://yarchive.net/comp/linux/efi.html
The result should be generation of intermediate files and the final hello.efi program file of about 46KiB on a 64-bit system
That's bigger than the whole MS-DOS 3.2 kernel.
If you use coreboot and libpayload it's much easier because it offers you built-in GDB server you can connect to via serial port.