Last change
on this file since 176 was 174, checked in by krille_n_@…, 13 years ago |
Changes to XTIDE Universal BIOS:
- Excluded the Math_DivDXAXbyCX procedure as it is currently unused. Also made it 2 bytes smaller.
|
File size:
1.4 KB
|
Line | |
---|
1 | ; Project name : Assembly Library
|
---|
2 | ; Description : Functions for register operations.
|
---|
3 |
|
---|
4 |
|
---|
5 | ; Section containing code
|
---|
6 | SECTION .text
|
---|
7 |
|
---|
8 | ;--------------------------------------------------------------------
|
---|
9 | ; Math_DivQWatSSBPbyCX
|
---|
10 | ; Parameters:
|
---|
11 | ; [SS:BP]: 64-bit unsigned divident
|
---|
12 | ; CX: 16-bit unsigned divisor
|
---|
13 | ; Returns:
|
---|
14 | ; [SS:BP]: 64-bit unsigned quotient
|
---|
15 | ; DX: 16-bit unsigned remainder
|
---|
16 | ; Corrupts registers:
|
---|
17 | ; AX
|
---|
18 | ;--------------------------------------------------------------------
|
---|
19 | ALIGN JUMP_ALIGN
|
---|
20 | Math_DivQWatSSBPbyCX: ; This procedure is included but not used in XTIDECFG
|
---|
21 | xor dx, dx
|
---|
22 | mov ax, [bp+6] ; Load highest divident WORD to DX:AX
|
---|
23 | div cx
|
---|
24 | mov [bp+6], ax ; Store quotient
|
---|
25 |
|
---|
26 | mov ax, [bp+4]
|
---|
27 | div cx
|
---|
28 | mov [bp+4], ax
|
---|
29 |
|
---|
30 | mov ax, [bp+2]
|
---|
31 | div cx
|
---|
32 | mov [bp+2], ax
|
---|
33 |
|
---|
34 | mov ax, [bp]
|
---|
35 | div cx
|
---|
36 | mov [bp], ax
|
---|
37 | ret
|
---|
38 |
|
---|
39 |
|
---|
40 | ;--------------------------------------------------------------------
|
---|
41 | ; Math_DivDXAXbyCX
|
---|
42 | ; Parameters:
|
---|
43 | ; DX:AX: 32-bit unsigned divident
|
---|
44 | ; CX: 16-bit unsigned divisor
|
---|
45 | ; Returns:
|
---|
46 | ; DX:AX: 32-bit unsigned quotient
|
---|
47 | ; BX: 16-bit unsigned remainder
|
---|
48 | ; Corrupts registers:
|
---|
49 | ; Nothing
|
---|
50 | ;--------------------------------------------------------------------
|
---|
51 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
|
---|
52 | ALIGN JUMP_ALIGN
|
---|
53 | Math_DivDXAXbyCX: ; This procedure is included but not used in XTIDECFG
|
---|
54 | xor bx, bx
|
---|
55 | xchg bx, ax
|
---|
56 | xchg dx, ax
|
---|
57 | div cx
|
---|
58 | xchg ax, bx
|
---|
59 | div cx
|
---|
60 | xchg dx, bx
|
---|
61 | ret
|
---|
62 | %endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.