evocation/hello.e
Irene Knapp d5030a4cf7
all the syscall parameters are in the kernel's order now
there was never a good reason for them not to be

plus, the formerly bespoke ones use the generic helpers now; sys-open and sys-close are implemented; and a bug in push-input-buffer and pop-output-buffer is fixed

unfortunately these were breaking changes, so there's another evoke.hex in this one

Change-Id: Ifad58fc2fd757adcf89a69c59575565a10406ec2
Force-Push: yes
2026-09-23 02:27:52 -07:00

36 lines
888 B
Text

~ cat labels.e elf.e hello.e | ./quine > hello && chmod 755 hello && ./hello
: output-start-routine
current-offset L!' cold-start
1 :rax mov-reg64-imm32
1 :rdi mov-reg64-imm64
L@' origin L@' greeting + :rsi mov-reg64-imm64
L@' greeting-size :rdx mov-reg64-imm64
syscall
60 :rax mov-reg64-imm32
0 :rdi mov-reg64-imm32
syscall
;
: output-greeting
current-offset dup L!' greeting 3unroll
s" Hello, Irenes!" packstring
current-offset 4 roll - L!' greeting-size ;
~ (output memory start, current output point
~ -- output memory start, current output point)
~
~ Everything directly called by all-contents has this same interface.
~
: all-contents
0x08000000 L!' origin
elf-file-header
elf-program-header
output-start-routine
output-greeting
current-offset L!' total-size
;
' all-contents entry-to-execution-token label-loop
1 3unroll sys-write bye