URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [go32/] [dosmem.S] - Rev 1765
Compare with Previous | Blame | View Log
/* DOSMEM.S *//*** Copyright (C) 1993 C.W. Sandmann**** This file may be freely distributed as long as the author's name remains.** Extender environment independent way to set up Real area 1Mb access.** Procedure takes a single argument %eax which contains the real area offset.** After call, access may be made with "%gs:(%eax)"*/.text.align 2.globl dosmemsetupdosmemsetup: /* no params, expected ASM call only */pushl %eaxmovzwl __core_select,%eaxtestl %eax,%eaxje old_go32 /* Image run with pre-DPMI extender */movw %ax,%gs /* Use real area selector */popl %eax /* Plus real offset */andl $0x0fffffff,%eax /* Clear any linear access bits */ret.align 2,0x90old_go32:push %dspop %gs /* Use arena selector */popl %eaxorl $0xe0000000,%eax /* Plus linear access area */ret.align 2.globl _dosmemget_dosmemget: /* long offset, long len, long *buf */push %gsmovl 8(%esp),%eax /* offset */call dosmemsetupmovl 12(%esp),%ecx /* length */movl 16(%esp),%edx /* arena offset */pushl %esipushl %edimovl %eax,%esimovl %edx,%edipush %dspush %espush %dspop %espush %gspop %dscldrepmovsb /* move ECX bytes from Real area */pop %espop %dspopl %edipopl %esipop %gsret.align 2.globl _dosmemput_dosmemput: /* long *buf, long len, long offset */push %gsmovl 16(%esp),%eax /* offset */call dosmemsetupmovl 12(%esp),%ecx /* length */movl 8(%esp),%edx /* arena offset */pushl %esipushl %edimovl %eax,%edimovl %edx,%esipush %espush %gspop %escldrepmovsb /* move ECX bytes to Real area */pop %espopl %edipopl %esipop %gsret.align 2 /* 8(bp) 12(bp) 16(bp) 20(bp) 24(bp) */.globl _movedata /* src_sel, src_ofs, dest_sel, dest_ofs, len */_movedata:pushl %ebpmovl %esp,%ebppushw %dspushw %espushl %esipushl %edimovl 8(%ebp),%eaxmovw %ax,%dsmovl 12(%ebp),%esimovl 16(%ebp),%eaxmovw %ax,%esmovl 20(%ebp),%edimovl 24(%ebp),%ecxpushl %ecxshrl $2,%ecxjcxz no_big_moverepmovslno_big_move:popl %ecxandl $3,%ecxjcxz no_little_moverepmovsbno_little_move:popl %edipopl %esipopw %espopw %dsleaveret
