~z88dk-team/z88dk-pkg/trunk

« back to all changes in this revision

Viewing changes to libsrc/stdlib/ldiv.asm

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-02-12 08:23:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080212082349-wgijt44scmgje90o
Tags: 1.7.ds1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - build z88dk and z88dk-bin binary packages for lpia too
  - update Maintainer field as per spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; void ldiv(ldiv_t *d, long num, long denom)
 
2
; 12.2006 aralbrec
 
3
; CALLER linkage for function pointers
 
4
 
 
5
XLIB ldiv
 
6
LIB l_long_div
 
7
 
 
8
.ldiv
 
9
 
 
10
   ; setup for l_long_div: dehl = denom, stack = num
 
11
   
 
12
   pop af
 
13
   ex af,af                 ; af' = return address
 
14
   pop hl
 
15
   pop de
 
16
   call l_long_div          ; dehl = q, de'hl' = r
 
17
   ex de,hl
 
18
   ex (sp),hl               ; hl = ldiv_t *
 
19
   ld (hl),e
 
20
   inc hl
 
21
   ld (hl),d
 
22
   inc hl
 
23
   pop de
 
24
   ld (hl),e
 
25
   inc hl
 
26
   ld (hl),d
 
27
   inc hl
 
28
   push hl
 
29
   exx
 
30
   ex de,hl
 
31
   ex (sp),hl
 
32
   ld (hl),e
 
33
   inc hl
 
34
   ld (hl),d
 
35
   inc hl
 
36
   pop de
 
37
   ld (hl),e
 
38
   inc hl
 
39
   ld (hl),d
 
40
   ld hl,-6
 
41
   add hl,sp
 
42
   ld sp,hl
 
43
   ex af,af
 
44
   push af
 
45
   ret