At the time of this writing, most such code examples available on the web were meant for the Netwide Assembler (NASM). Very little material was available that could be tried with the readily available GNU tools like the GNU assembler (as)
That's largely because no one wants to use GNU/AT&T assembler syntax. In the official Intel syntax, the important 4 lines of code would be more like
mov ax, 0b800h ; ax = b800
mov ds, ax ; ds = ax
mov byte ptr [0], 'A' ; ds:[0] = 'A'
mov byte ptr [1], 1eh ; ds:[1] = 1e
...and I immediately feel compelled to optimise it to (186+) push 0b800h
pop ds
mov word ptr [0], 1e41h
Also, especially with newer CPUs and on a laptop, it's a good idea to put a HLT in the infinite loop, like so: idle:
hlt
jmp idle
A halt causes the CPU to spend most of the time waiting for an interrupt, instead of spinning in a tight loop and wasting far more power than necessary.