home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
OSBIND.CPP
< prev
next >
Wrap
Text File
|
1993-08-03
|
10KB
|
559 lines
|
| new osbind.c definitions for the MiNT library. With these ones, we
| are now compatible with the rest of the atari world when using 16 bit
| integers, and the 32 bit code stuff should be portable, at least
| (albeit slower than the old osbind.c)
|
#ifdef __MSHORT__
.globl _gemdos
.globl _xbios
.globl _bios
.text
.even
_gemdos:
lea sp@(20), a0 | 4 bytes for ret addr + 16 for parameters
moveml d2/a2, sp@- | save reggies that TOS clobbers but that
| gcc thinks functions should preserve
movel a0@-, sp@- | max. of 16 bytes parameters to trap #1
movel a0@-, sp@-
movel a0@-, sp@-
movel a0@-, sp@-
trap #1 | go do the trap
addl #16, sp | pop parameters
moveml sp@+, d2/a2 | restore reggies
rts | return
_bios:
lea sp@(24), a0 | 4 bytes ret. addr. + 20 bytes parameters
moveml d2/a2, sp@-
movel a0@-, sp@- | copy 20 bytes of trap #13 parameters
movel a0@-, sp@-
movel a0@-, sp@-
movel a0@-, sp@-
movel a0@-, sp@-
trap #13 | go do the trap
addl #20, sp
moveml sp@+, d2/a2
rts
_xbios:
lea sp@(32), a0 | 28 bytes of parameters
moveml d2/a2, sp@-
movel a0@-, sp@- | copy 28 bytes
movel a0@-, sp@-
movel a0@-, sp@-
movel a0@-, sp@-
movel a0@-, sp@-
movel a0@-, sp@-
movel a0@-, sp@-
trap #14 | go do the trap
addl #28, sp
moveml sp@+, d2/a2
rts
#else /* !__MSHORT__ */
.text
.even
.globl _trap_1_w
_trap_1_w:
moveml d2/a2, sp@-
movel sp@(12), d0
movew d0, sp@-
trap #1
addql #2, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_ww
_trap_1_ww:
moveml d2/a2, sp@-
movel sp@(16), d1
movel sp@(12), d0
movew d1, sp@-
movew d0, sp@-
trap #1
addql #4, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wl
_trap_1_wl:
moveml d2/a2, sp@-
movel sp@(16), d1
movel sp@(12), d0
movel d1, sp@-
movew d0, sp@-
trap #1
addql #6, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wlw
_trap_1_wlw:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movew a0, sp@-
movel d1, sp@-
movew d0, sp@-
trap #1
addl #8, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wwl
_trap_1_wwl:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #1
addl #8, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_www
_trap_1_www:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #1
addql #6, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wll
_trap_1_wll:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a0, sp@-
movel d1, sp@-
movew d0, sp@-
trap #1
addl #10, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wwll
_trap_1_wwll:
moveml d2/a2, sp@-
movel sp@(24), a1
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a1, sp@-
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #1
addl #12, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wlww
_trap_1_wlww:
moveml d2/a2, sp@-
movel sp@(24), a1
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movew a1, sp@-
movew a0, sp@-
movel d1, sp@-
movew d0, sp@-
trap #1
addl #10, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wwlw
_trap_1_wwlw:
moveml d2/a2, sp@-
movel sp@(24), a1
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movew a1, sp@-
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #1
addl #10, sp
moveml sp@+, d2/a2
rts
.globl _trap_1_wwlll
_trap_1_wwlll:
moveml d2/a2, sp@-
movel sp@(28), a1
movel sp@(24), a0
movel sp@(20), d1
movel a1, sp@-
movel a0, sp@-
movel d1, sp@-
movel sp@(16+12), d1
movel sp@(12+12), d0
movew d1, sp@-
movew d0, sp@-
trap #1
addl #16, sp
moveml sp@+, d2/a2
rts
.globl _trap_13_w
_trap_13_w:
moveml d2/a2, sp@-
movel sp@(12), d0
movew d0, sp@-
trap #13
addql #2, sp
moveml sp@+, d2/a2
rts
.globl _trap_13_ww
_trap_13_ww:
moveml d2/a2, sp@-
movel sp@(16), d1
movel sp@(12), d0
movew d1, sp@-
movew d0, sp@-
trap #13
addql #4, sp
moveml sp@+, d2/a2
rts
.globl _trap_13_wl
_trap_13_wl:
moveml d2/a2, sp@-
movel sp@(16), d1
movel sp@(12), d0
movel d1, sp@-
movew d0, sp@-
trap #13
addql #6, sp
moveml sp@+, d2/a2
rts
.globl _trap_13_www
_trap_13_www:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #13
addql #6, sp
moveml sp@+, d2/a2
rts
.globl _trap_13_wwl
_trap_13_wwl:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #13
addl #8, sp
moveml sp@+, d2/a2
rts
.globl _trap_13_wwlwww
_trap_13_wwlwww:
moveml d2/a2, sp@-
movel sp@(32), a0
movel sp@(28), d1
movel sp@(24), d0
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
movel sp@(20+6), a0
movel sp@(16+6), d1
movel sp@(12+6), d0
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #13
addl #14, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_w
_trap_14_w:
moveml d2/a2, sp@-
movel sp@(12), d0
movew d0, sp@-
trap #14
addql #2, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_ww
_trap_14_ww:
moveml d2/a2, sp@-
movel sp@(16), d1
movel sp@(12), d0
movew d1, sp@-
movew d0, sp@-
trap #14
addql #4, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wl
_trap_14_wl:
moveml d2/a2, sp@-
movel sp@(16), d1
movel sp@(12), d0
movel d1, sp@-
movew d0, sp@-
trap #14
addql #6, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_www
_trap_14_www:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #14
addql #6, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wwl
_trap_14_wwl:
moveml d2/a2, sp@-
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #14
addl #8, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wwll
_trap_14_wwll:
moveml d2/a2, sp@-
movel sp@(24), a1
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a1, sp@-
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #14
addl #12, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wllw
_trap_14_wllw:
moveml d2/a2, sp@-
movel sp@(24), a1
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movew a1, sp@-
movel a0, sp@-
movel d1, sp@-
movew d0, sp@-
trap #14
addl #12, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wlll
_trap_14_wlll:
moveml d2/a2, sp@-
movel sp@(24), a1
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a1, sp@-
movel a0, sp@-
movel d1, sp@-
movew d0, sp@-
trap #14
addl #14, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wwwl
_trap_14_wwwl:
moveml d2/a2, sp@-
movel sp@(24), a1
movel sp@(20), a0
movel sp@(16), d1
movel sp@(12), d0
movel a1, sp@-
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #14
addl #10, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wwwwl
_trap_14_wwwwl:
moveml d2/a2, sp@-
movel sp@(28), d0
movel d0, sp@-
movel sp@(24+4), a1
movel sp@(20+4), a0
movel sp@(16+4), d1
movel sp@(12+4), d0
movew a1, sp@-
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #14
addl #12, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wllww
_trap_14_wllww:
moveml d2/a2, sp@-
movel sp@(28), d1
movel sp@(24), d0
movew d1, sp@-
movew d0, sp@-
movel sp@(20+4), a0
movel sp@(16+4), d1
movel sp@(12+4), d0
movel a0, sp@-
movel d1, sp@-
movew d0, sp@-
trap #14
addl #14, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wwwwwww
_trap_14_wwwwwww:
moveml d2/a2, sp@-
movel sp@(36), a1
movel sp@(32), a0
movel sp@(28), d1
movel sp@(24), d0
movew a1, sp@-
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
movel sp@(20+8), a0
movel sp@(16+8), d1
movel sp@(12+8), d0
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
trap #14
addl #14, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wllwwwww
_trap_14_wllwwwww:
moveml d2/a2, sp@-
movel sp@(40), a1
movel sp@(36), a0
movel sp@(32), d1
movel sp@(28), d0
movew a1, sp@-
movew a0, sp@-
movew d1, sp@-
movew d0, sp@-
movel sp@(24+8), a1
movel sp@(20+8), a0
movel sp@(16+8), d1
movel sp@(12+8), d0
movew a1, sp@-
movel a0, sp@-
movel d1, sp@-
movew d0, sp@-
trap #14
addl #20, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wllwwwwlw
_trap_14_wllwwwwlw:
moveml d2/a2, sp@-
movel sp@(44), a1
movel sp@(40), a0
movel sp@(36), d1
movel sp@(32), d0
movew a1, sp@-
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
movel sp@(28+10), a1
movel sp@(24+10), a0
movel sp@(20+10), d1
movel sp@(16+10), d0
movel sp@(12+10), d2
movew a1, sp@-
movew a0, sp@-
movel d1, sp@-
movel d0, sp@-
movew d2, sp@-
trap #14
addl #24, sp
moveml sp@+, d2/a2
rts
.globl _trap_14_wllwwwwwlw
_trap_14_wllwwwwwlw:
moveml d2/a2, sp@-
movel sp@(48), a1
movel sp@(44), a0
movel sp@(40), d1
movel sp@(36), d0
movew a1, sp@-
movel a0, sp@-
movew d1, sp@-
movew d0, sp@-
movel sp@(32+10), a1
movel sp@(28+10), a0
movel sp@(24+10), d1
movel sp@(20+10), d0
movel sp@(8+10), d2
movel sp@(4+10), a2
movew a1, sp@-
movew a0, sp@-
movew d1, sp@-
movel d0, sp@-
movel d2, sp@-
movew a2, sp@-
trap #14
addl #26, sp
moveml sp@+, d2/a2
rts
#endif