File: udivbug.s

package info (click to toggle)
tkisem 4.5.12-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 964 kB
  • ctags: 1,372
  • sloc: cpp: 4,844; tcl: 3,047; asm: 1,991; makefile: 335; ansic: 269; sh: 155
file content (24 lines) | stat: -rw-r--r-- 386 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
	!
	! $Id: udivbug.s 1.1 Fri, 25 Oct 1996 18:04:04 -0600 maccabe $
	!
	! illustrates an earlier bug in the unsigned division code
	!
	! The result in %r2 was 0x05a5a5a6.
	! The correct value is  0x03c3c3c4.

	.data
a:	.word 0x42
c: 	.word 0x44

	.text
start:	mov	0x1, %y
	set 	a, %r1
	ld	[%r1], %r2
	set	c, %r1
	ld	[%r1], %r4
	nop

	udiv	%r2, %r4, %r2	! %y, %r2 / c --> %r2

end:	ta	0