home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ASMPRG.ZIP / OS2ASM.ASM < prev    next >
Assembly Source File  |  1993-01-10  |  3KB  |  89 lines

  1. ;==============================================================================;
  2. ; OS/2 2.0 Assembler Routines                                                  ;
  3. ;                                                                              ;
  4. ; os2asm.asm      Test program                                                 ;
  5. ;                                                                              ;
  6. ; Author: Larry Morley                                  (c) Larry Morley, 1993 ;
  7. ;==============================================================================;
  8.  
  9.                   INCLUDELIB os2386.lib
  10.                   INCLUDELIB os2286.lib
  11.  
  12.                   INCLUDE std20.inc
  13.                   INCLUDE stdmac20.inc
  14.  
  15. DCLSTACK
  16.  
  17. BEGINDATA
  18.                   szMsgLine00  DB "OS/2 Version 2.0 Assembler Routines",13,10,0
  19.                   szMsgline01  DB "by Larry Morley",13,10,13,10,0
  20.                   szMsgline02  DB "(c) 1993 Larry Morley, All Rights Reserved.",
  21.                                13,10,0
  22. ENDDATA
  23.  
  24. EXTRN             _strlen   : NEAR32
  25. EXTRN             _getkey   : NEAR32
  26. EXTRN             DosExit   : NEAR32
  27. EXTRN             VioWrtTTY : NEAR32
  28.  
  29. ;------------------------------------------------------------------------------
  30.  
  31. CODE32            SEGMENT
  32.                   ASSUME  CS:CODE32,SS:STACK32,DS:DATA32
  33.  
  34. _main             PROC
  35.  
  36.                   ;=========================;
  37.  
  38.                   ; prepare the thunking layer for a call to VioWrtTTY
  39.                   ; using PREP16 <function_address>
  40.                   PREP16  VioWrtTTY
  41.  
  42.                   ; push ptr to string and convert to selector:offset
  43.                   CVTLP16 szMsgLine00
  44.  
  45.                   ; push string length in bytes, and VIO handle (0)
  46.                   ; note use of PUSHW to force size of pushed item
  47.                   PUSH    OFFSET FLAT:szMsgLine00
  48.                   CALL    _strlen
  49.                   PUSH    AX
  50.  
  51.                   PUSHW   0
  52.  
  53.                   ; call the thunking layer's 32-bit setup-and-go proc
  54.                   CALL16
  55.  
  56.                   ; return value is in registers...
  57.  
  58.                   ;=========================;
  59.  
  60.                   PREP16  VioWrtTTY
  61.                   CVTLP16 szMsgLine01
  62.                   PUSH    OFFSET FLAT:szMsgLine01
  63.                   CALL    _strlen
  64.                   PUSH    AX
  65.                   PUSHW   0
  66.                   CALL16
  67.  
  68.                   PREP16  VioWrtTTY
  69.                   CVTLP16 szMsgLine02
  70.                   PUSH    OFFSET FLAT:szMsgLine02
  71.                   CALL    _strlen
  72.                   PUSH    AX
  73.                   PUSHW   0
  74.                   CALL16
  75.  
  76.                   CALL    _getkey
  77.  
  78.                   ;=========================;
  79.  
  80.                   $$DosExit 1,0
  81.  
  82. _main             ENDP
  83.  
  84. ;-------------------------------------------------------------------------------
  85.  
  86. CODE32            ENDS
  87.                   END     _main
  88.  
  89.