-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpowers.asm
More file actions
28 lines (23 loc) · 795 Bytes
/
powers.asm
File metadata and controls
28 lines (23 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.386P
.model flat
extern _printf:near
public _main
.code
_main:
push esi ; callee-save registers
push edi
mov esi, 1 ; current value
mov edi, 31 ; counter
L1:
push esi ; push value to print
push offset format ; push address of format string
call _printf
add esp, 8 ; pop off parameters passed to printf
add esi, esi ; double value
dec edi ; keep counting
jnz L1
pop edi
pop esi
ret
format: byte '%d', 10, 0
end