I am trying to write a test program in AT&T syntax assembly that pushes the ascii value of some characters to the stack, then prints them. My code is as follows:
.text
.global main
main:
push $0
push $10
push $65
mov $4,%eax
mov $1,%ebx
mov %esp,%ecx
mov $3,%edx
int $0x80
mov $1,%eax
int $0x80
What I would expect this program to do is push 0, 10, and 65 to the stack so that the stack is 65, 10, 0 (capital A, new-line, end of string). Set eax
and ebx
to the values for writing to stdout, and setting ecx
to the stack pointer so that it writes what's on the stack, while edx
is the length of what's on the stack(i.e. 3). When I run this, absolutely nothing happens. Can you help me understand what I'm doing wrong and what is actually happening here?