Update assembly x86 safety example
This commit is contained in:
@@ -7,7 +7,7 @@ juliet:
|
|||||||
stop:
|
stop:
|
||||||
# Try changing this number. What happens? Why?
|
# Try changing this number. What happens? Why?
|
||||||
# Hint: try 0, 1, 11, 12, 21, 22.
|
# Hint: try 0, 1, 11, 12, 21, 22.
|
||||||
.int 11
|
.int 12
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.global _start
|
.global _start
|
||||||
@@ -23,7 +23,7 @@ _start:
|
|||||||
# Setup.
|
# Setup.
|
||||||
lea romeo, %rax # Load the starting address of string into %rax.
|
lea romeo, %rax # Load the starting address of string into %rax.
|
||||||
mov $0xb98c9ff0, %ebx # 🌹 = b98c9ff0 (4 bytes)
|
mov $0xb98c9ff0, %ebx # 🌹 = b98c9ff0 (4 bytes)
|
||||||
mov $0, %rcx # Set the intial counter.
|
mov $0, %rcx # Set the initial counter.
|
||||||
|
|
||||||
# Overwrite the strings with 🌹.
|
# Overwrite the strings with 🌹.
|
||||||
# Increment the address in %rax by four bytes on each iteration.
|
# Increment the address in %rax by four bytes on each iteration.
|
||||||
|
|||||||
Reference in New Issue
Block a user