Blame view

ref-impl/x/grok.s 384 Bytes
f2c4dc81   Salvador Abreu   added most of the...
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
29
30
31
32
33
34
#NO_APP
.text
	.align 1
_fact:
	.word 0x0
	movl 4(ap),r1
	movl 8(ap),r0
	cmpl r1,$1
	jgtr L1
	ret
L1:
	mull2 r1,(r0)
	pushl r0
	pushab -1(r1)
	calls $2,_fact
	ret
	.align 0
LC0:
	.ascii "%d\12\0"
	.align 1
.globl _main
_main:
	.word 0x0
	subl2 $4,sp
	pushab -4(fp)
	movl 8(ap),r1
	pushl 4(r1)
	calls $1,_atoi
	pushl r0
	calls $2,_fact
	pushl -4(fp)
	pushab LC0
	calls $2,_printf
	ret