Skip to content

Commit e56ef1a

Browse files
committed
new macros: log, plop
1 parent 732fcbd commit e56ef1a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

group3/group3.s

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,9 @@ print_lines_loop:
178178

179179

180180
push linebuf(%rip)
181-
push %rax
182-
call write_string
183-
pop %rax
184-
pop %rax
185-
pop %rax
181+
log %rax
182+
plop
183+
plop
186184

187185
call write_newline
188186

print_int/print_int.s

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99
mov %rsp, %rbp
1010
.endm
1111

12+
.macro plop
13+
add $8, %rsp
14+
.endm
15+
16+
.macro log ex
17+
push \ex
18+
call write_string
19+
add $8, %rsp
20+
.endm
21+
1222
.macro return
1323
mov %rbp, %rsp
1424
pop %rbp

0 commit comments

Comments
 (0)