Assembly Language Programming Tutorial – 48 – SAR Instruction

All references in this video came from:
Assembly Language for x86 Processors (6th Edition) http://goo.gl/n3ApG

Brought to you by http://www.rasmurtech.com/

The Rasmurtech Community: http://goo.gl/mt6OzH

Rasim from Rasmurtech.com give us another tutorial on Assembly Language Programming . In this tutorial Rasim shows us how to use the SAR Instruction.

emu8086: http://goo.gl/AXgw2u

ASCII TABLE: http://goo.gl/qDqYDw

Wiki Answsers: Explain 8086 flag register http://wiki.answers.com/Q/Explain_8086_flag_register

Instagram: http://instagram.com/rasmurtech

Jimmy King says:

Don’t u know the difference between SAR & SHR ??!!

gidgnulur says:

SAR != SHR

Rasim Muratovic says:

#programming   #programminglanguage   #coding

Abuzar Ghafari says:

mov al,0F0h ; AL = 11110000b (-16)
sar al,1 ; AL = 11111000b (-8), CF = 0
you did’t tell any thing about the sign in sar. it conservers it sign after sar instruction.

Aqdar Alessai says:

thank u for the video,
But actually SHR Instruction is not identical to SAR
SAR shifts each bit to the right and copies the sign bit, so if we have ax= 1110 0011 and count of 3 then ax = 1111 1100 means we’ll insert the sign 3 times which is 1 and remove the first 3 bits.

James Wood says:

0xFF(-1) => SHR by 1 => 0x7F(127) — sign changed
0xFF(-1) => SAR by 1 => 0xFF(-1) — sign not changed