Skip to content

Commit f1c11b4

Browse files
committed
inc beef
1 parent 2e02a4c commit f1c11b4

2 files changed

Lines changed: 28 additions & 16 deletions

File tree

hello/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
default:
2-
$(CC) hello.s -c -g
1+
build:
2+
$(CC) hello.s -c
33
$(LD) -o hello hello.o
44

5-
check:
5+
check: build
66
./hello | md5sum | grep -q ^823c843e5 && printf "\033[1;32m[OK]\033[0m\n"
77

8-
run:
9-
./hello
8+
clean:
9+
rm -f hello

hello/hello.s

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@
33
_start:
44
pushq %rbp
55
movq %rsp, %rbp
6-
movb $48, -11(%rbp)
7-
movb $120, -10(%rbp)
8-
movb $100, -9(%rbp)
9-
movb $101, -8(%rbp)
10-
movb $97, -7(%rbp)
11-
movb $100, -6(%rbp)
12-
movb $98, -5(%rbp)
13-
movb $101, -4(%rbp)
14-
movb $101, -3(%rbp)
15-
movb $102, -2(%rbp)
16-
movb $10, -1(%rbp)
6+
mov $0, %rcx
7+
movb $0x30, -11(%rbp, %rcx) # "0"
8+
inc %rcx
9+
movb $0x78, -11(%rbp, %rcx) # "x"
10+
inc %rcx
11+
movb $0x64, -11(%rbp, %rcx) # "d"
12+
inc %rcx
13+
movb $0x65, -11(%rbp, %rcx) # "e"
14+
inc %rcx
15+
movb $0x61, -11(%rbp, %rcx) # "a"
16+
inc %rcx
17+
movb $0x64, -11(%rbp, %rcx) # "d"
18+
inc %rcx
19+
movb $0x62, -11(%rbp, %rcx) # "b"
20+
inc %rcx
21+
movb $0x65, -11(%rbp, %rcx) # "e"
22+
inc %rcx
23+
movb $0x65, -11(%rbp, %rcx) # "e"
24+
inc %rcx
25+
movb $0x66, -11(%rbp, %rcx) # "f"
26+
inc %rcx
27+
movb $0xa, -11(%rbp, %rcx)
28+
inc %rcx
1729
mov $11, %rdx
1830
leaq -11(%rbp), %rsi
1931
mov $1, %rdi

0 commit comments

Comments
 (0)