home *** CD-ROM | disk | FTP | other *** search
- page 58,132
-
- ;
- ; tinyfns.asm
- ; contains: getcs(),getss(),getax(),getbx(),getcx(),getdx(),getsi(),getdi(),
- ; contains: getbp(),getsp(),ofsspu(),ptrcnv().
- ;
- include model.h
- include prologue.h
- name tinyfns
-
- ;; AUTHOR:
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;
- ;; MODIFICATIONS:
- ;
- ;;;
- pseg tinyfns
-
- ;==>-- unsigned getcs()
- ;
- ; Returns value of CS register
- ;
- cproc getcs
- if _LCODE
- mov ax,[bp+4]
- else
- mov ax,cs
- endif
- cproce
-
- ;==>-- unsigned getss()
- ;
- ; Returns value of SS register
- ;
- cproc getss,,,,,<LRA>
- mov ax,ss
- cproce
-
-
- ;==>-- unsigned getax()
- ;
- ; Returns value of AX register
- ;
- cproc getax,,,,,<LRA>
- ;it's already there!
- cproce
-
- ;==>-- unsigned getbx()
- ;
- ; Returns value of BX register
- ;
- cproc getbx,,,,,<LRA>
- mov ax,bx
- cproce
-
- ;==>-- unsigned getcx()
- ;
- ; Returns value of CX register
- ;
- cproc getcx,,,,,<LRA>
- mov ax,cx
- cproce
-
- ;==>-- unsigned getdx()
- ;
- ; Returns value of DX register
- ;
- cproc getdx,,,,,<LRA>
- mov ax,dx
- cproce
-
- ;==>-- unsigned getsi()
- ;
- ; Returns value of SI register
- ;
- cproc getsi,,,,,<LRA>
- mov ax,si
- cproce
-
- ;==>-- unsigned getdi()
- ;
- ; Returns value of DI register
- ;
- cproc getdi,,,,,<LRA>
- mov ax,di
- cproce
-
- ;==>-- unsigned getbp()
- ;
- ; Returns value of BP register
- ;
- cproc getbp,,,,,<LRA>
- mov ax,bp
- cproce
-
- ;==>-- unsigned getsp()
- ;
- ; Returns value of SP register
- ;
- cproc getsp,,,,,<LRA>
- mov ax,sp
- cproce
-
- ;==>-- unsigned segspu(pointer)
- ; char *pointer;
- ;
- ; Return segment of DATA pointer.
- ;
- cproc segspu
- if _LDATA
- push ds
- lds ax,dword ptr parm1_
- mov ax,ds
- pop ds
- else
- mov ax,ds
- endif
- cproce
-
- ;==>-- unsigned ofsspu(pointer)
- ; char *pointer;
- ;
- ; Return offset of DATA pointer.
- ;
- cproc ofsspu
- if _LDATA
- push ds
- lds ax,dword ptr parm1_
- pop ds
- else
- mov ax,parm1_
- endif
- cproce
-
- ;==>-- char *ptrcnv(seg,ofs)
- ; unsigned seg,ofs;
- ;
- ; Convert segment:offset to long (far) pointer. Small data model
- ; programs should declar this function long ptrcnv(); if they expect
- ; to get a 32 bit value returned.
- ;
- cproc ptrcnv
- ifndef AXBX32
- mov dx,parm1_
- mov ax,parm2_
- else
- mov ax,parm1_
- mov bx,parm2_
- endif
- cproce
- endps
- end
-