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.

Download:

emu8086: http://goo.gl/AXgw2u

Binary to Decimal to Hexadecimal Converter: http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html

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

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

Google Plus: https://plus.google.com/112317437942092121047

Twitter: https://twitter.com/rasmurtech

Facebook: https://www.facebook.com/Rasmurtech‎

Instagram: http://instagram.com/rasmurtech

Comments

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

 Write a comment

*

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!