Question: Introduction to Assembly language commands Shift instructions shl shr sal sar rol ror Set rax to 0x1 Shift left 1 time Print the value Shift

Introduction to Assembly language commands

Shift instructions shl shr sal sar rol ror

Set rax to 0x1

Shift left 1 time

Print the value

Shift left 1 time

Print the value

Shift left 1 time

Print the value

SAL and SHL are actually the same op code

See the example of the assembly in ddd.

The line with sal is displayed as shl

Introduction to Assembly language commands Shift instructions shl shr sal sar rol

Set rax to 0x1

Shift left 1 time (Arithmetic)

Print the value

Shift left 1 time

Print the value

Shift left 1 time

Print the value

Set rax to 0x8000000000000008

Shift right 1 time (Arithmetic)

Print the value

Shift right 1 time

Print the value

Shift right 1 time

Print the value

Set rax to 0xF000000000000000

Rotate Left 1 time (Arithmetic)

Print the value

Rotate Left 1 time

Print the value

Rotate Left 1 time

Print the value

Set rax to 0xF

Rotate right 1 time (Arithmetic)

Print the value

Rotate right 1 time

Print the value

Rotate right 1 time

Print the value

ror Set rax to 0x1 Shift left 1 time Print the value

eal rax,1 shr ra, 1 sar ran, 1 nov rax, 0x800000000000000F sal rax, 1 call printRAX call exitHornal l3 0N400 0x0000000000400122 114: shr rax 0x00000000004001253 0N400 0x0000000000400122 114: shr rax 0x0000000000400125

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!