Skip to content
Advertisement

Tag: assembly

Why doesn’t the ‘syscall’ instruction work under Linux?

I have a very basic assembly program that runs in Linux userland: However, this doesn’t work as it is, but only if I replace the syscalls with int 0x80. Don’t these do the same thing? I know that syscall was designed to be lower-latency, but other than that, I didn’t think there was a difference. Why doesn’t it work? Answer

mov edx overwrites cx register

I’m trying to print Hi 10 times. This is my code. gdb reports that mov edx, 3 overwrites the cx register to some crazy value and so the loop keeps going forever. What am i doing wrong? Is it because they are the same register? How does one program in assembly with so few registers? Compiling on centos with nasm

Convert from ascii to integer in AT&T Assembly

How can I convert from ascii to integer? The code is writing an ascii value, and I think that if I can add 48 to value. I can write, but I can’t print, a two-stage number “for example 53 or 156”. How can I print? Answer It’s usually best to think about a high level language version first. If the

Advertisement