Мне нужно построить 8-битное число, которое построено так: левые 4 бита от первого числа, правые 4 бита от второго числа
Я не знаюне знаю, хотите ли вы что-то вроде этого:
mov ax,[si] ;al = first character, ah = second character
shl al,4 ;al bits 4 to 7 = lowest 4 bits of first character
shr ax,4 ;al bits 0 to 3 = lowest 4 bits of first character, al bits 4 to 7 = lowest 4 bits of second character
.. или что-то вроде этого:
mov ax,[si] ;al = first character, ah = second character
and ax,0xF00F ;al bits 0 to 3 = lowest 4 bits of first character, ah bits 4 to 7 = highest 4 bits of second character
or al,ah ;al bits 0 to 3 = lowest 4 bits of first character, al bits 4 to 7 = highest 4 bits of second character
.. или что-то вроде этого:
mov ax,[si] ;al = first character, ah = second character
and ax,0x0FF0 ;al bits 4 to 7 = highest 4 bits of first character, ah bits 0 to 3 = lowest 4 bits of second character
or al,ah ;al bits 0 to 3 = lowest 4 bits of second character, al bits 4 to 7 = highest 4 bits of first character
... или что-то еще.