Old tutorials, specially for 8086, use LOOP, XLAT, and instructions like that. I recomend you don't use them. Why? Because they are SLOW. This loop:
mov ecx,10
.loop:
call doSomthing
loop .loop
Works, but is slower than this one:
mov ecx,10
.loop
call doSomething
dec ecx
jne .loop
Even if some processors impose a penalty in DEC instruction (because of read-modify-write the EFLAGS, since CF is not affected by DEC)... This is even a little bit faster:
mov ecx,10
.loop:
call doSomething
sub ecx,1
jne .loop
The same warning goes to XLAT and XLATB. For those not familiar with these instructions, thay take BX (or EBX) as base of an array and AL as index (yep 8 bits!). If you want to get the 3rd byte from an array you could do:
lea ebx,[array]
mov al,2 ; remember, offsets start at 0!
xlatb
But, of couse, this is faster and takes less code space:
mov al,[array+2]
That's why some high level compiler (like GCC) don't use a lot of available instructions: Because they are slow or takes a lot of space.
Ahhh... if you still want to use AL as index, you can always do something like this:
movzx eax,al
mov al,[array+eax]
Still faster than use XLATB (and you don't need EBX). And, yep, unless you are using a pre-386 processor, this is valid in real mode as well...