I had a go at it, and tried: Sorry about all the XOR instructions, I just wanted to make sure registers were cleared before I used them for a system call, I’m still learning assembly and not sure about what instructions will render a register empty. When I compile, link and run this I can enter the two integers only
Tag: nasm
Clear screen in a Linux terminal using assembly?
Is there a way to clear the screen in a terminal window with nasm? By clear the screen, I mean emulate the Ctrl-L hotkey. Remove all text from the window. Answer In Bash: In C: How do I find the string:
Why data and stack segments are executable?
I have just noticed that my simple program has its data and stack segments executable. I saw it in /proc/[pid]/maps, and simple code confirmed it. For example: then causes prog to execute int3 instruction. Programs written in C and built with gcc have their data, stack and heap non-executable, so why those written in assembly behave in a different manner?