#x86 assembly/DOS
org 100h
start:
mov dx,data
mov ah,9h
int 21h
push start
ret
data:
db "Hello World!",10,13,"$"
Did I say no reversed tail recursion? Did I?
How it works
The
ret
instruction, used to return from a function, actually pops the return address from the stack (which normally is put there by the correspondingcall
) and jumps to it. Here at each iteration wepush
the entrypoint address on the stack before returning, thus generating an infinite loop.