s2asm header files

s2asm header files

Post by Earl Ch » Sat, 28 Apr 1990 13:49:10



Here are the two s2asm files that I used to cross compile Minix.

Earl
-------------------------------------------------------------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#               "End of shell archive."
# Contents:  asm.h model.h

PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'asm.h' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'asm.h'\"
else
echo shar: Extracting \"'asm.h'\" \(3004 characters\)
sed "s/^X//" >'asm.h' <<'END_OF_FILE'
X;                      s2asm Masm Header File
X;
X; This header file provides masm support for s2asm.
X;
X; Patchlevel 1.0
X;
X; Edit History:
X;
X; 10-Nov-1989  Prepare for release.
X; 30-Aug-1989  Created
X;
X
XINCLUDE                model.h
X
X; $LT
X; $LIT
X;
X; The $LIT macro deals with literals (eg mov ax,#value). The problem is
X; that the value can be either a pure constant, a .text label or a .data
X; label. With labels, the value of the literal must be computed as the
X; offset from the .TEXT segment in the case of a .text label or from
X; the DGROUP segment in the case of a .data label. MASM will compute
X; the offsets of labels with respect to their home segment. This gives
X; the wrong results for .data labels, hence the following contortions
X; to force the right segment.
X;
X; TASM will do the right thing in IDEAL mode, but the syntax is different
X; hence the need to split things up and assemble them differently.
X
X$LT    MACRO   opcode,qual,off,base,const
X       IFB <qual>
X         opcode base,const
X       ELSE
X         opcode qual off[base],const
X       ENDIF
XENDM
X
X$LIT   MACRO   opcode,qual,off,base,const
X       IFDEF ??version                 ;; defined for tasm only
X         IDEAL
X           IFB <qual>                    ;; no qual => just a move
X             opcode base, offset const
X           ELSEIFB <off>         ;; no offset => simple
X             opcode [qual (base)], offset const
X           ELSE
X             opcode [qual (base+off)], offset const
X           ENDIF
X         MASM
X         EXITM
X       ENDIF
X       IF      (.TYPE const) AND 20h   ;; is it defined (bit 5)
X         IF    (.TYPE const) AND 2h    ;; is it data relative symb (1)
X           $LT <opcode>,<qual>,<off>,<base>,<offset DGROUP: const>
X         ELSE
X           IF  (.TYPE const) AND 1h    ;; is it text symb (0)
X             $LT <opcode>,<qual>,<off>,<base>,<offset _TEXT: const>
X           ELSE
X             $LT <opcode>,<qual>,<off>,<base>,<const>
X           ENDIF
X         ENDIF
X       ELSE
X         $LT <opcode>,<qual>,<off>,<base>,<offset const>
X       ENDIF
XENDM
X
X; $GLO
X;
X; Globals can be handled by TASM but MASM (4.0) needs help. The semantics
X; are that if the label is defined here, then .globl is the same as
X; .define, but if it is not defined here, then .globl is the same as
X; .extern.
X
X$GLO   MACRO   type,vars
X       IFDEF ??version                 ;; defined for tasm only
X         IRP var,<vars>
X           GLOBAL      var:type
X         ENDM
X       ELSE
X         IRP var,<vars>
X           IF2
X             IFDEF var
X               PUBLIC  var
X             ELSE
X               EXTRN   var:type
X             ENDIF
X           ENDIF
X         ENDM
X       ENDIF
XENDM
X
X; $LCL
X; $JMP
X; $$L
X; $$LJ
X;
X; Local labels require a bit of magic. Each local label is mapped onto
X; a different MASM label. When $JMP sees a label being used, it either
X; uses a previously generated label, or it generates a new one and mark
X; that it exists. When the label is actually defined in $LCL, the
X; existence flag is cleared so that $JMP will generate a new label.

X

XENDM
X
X$$LJ   MACRO   jump,lll

XENDM
X
X$LCL   MACRO   ll




XENDM
X
X$JMP   MACRO   jump,ll


X       ENDIF



X       ENDIF

XENDM
END_OF_FILE
if test 3004 -ne `wc -c <'asm.h'`; then
    echo shar: \"'asm.h'\" unpacked with wrong size!
fi
# end of 'asm.h'
fi
if test -f 'model.h' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'model.h'\"
else
echo shar: Extracting \"'model.h'\" \(457 characters\)
sed "s/^X//" >'model.h' <<'END_OF_FILE'
X;
X;                      Model Include File
X;
X; Preserve maximum flexibility by reserving the separate I&D and
X; common I&D selection to the link phase.
X;
X; This file merely sets up the segment names.
X;
X; Patchlevel 1.0
X;
X; Edit History
X;
X; 14-Nov-1989  Prepare for release
X;
X_TEXT  segment byte public 'CODE'
X_TEXT  ends
X_DATA  segment word public 'DATA'
X_DATA  ends
X_BSS   segment word public 'BSS'
X_BSS   ends
X_STACK segment stack 'STACK'
X_STACK ends
XDGROUP group _DATA,_BSS,_STACK
END_OF_FILE
if test 457 -ne `wc -c <'model.h'`; then
    echo shar: \"'model.h'\" unpacked with wrong size!
fi
# end of 'model.h'
fi
echo shar: End of shell archive.
exit 0
-------------------------------------------------------------------------------
--
Earl Chew, Dept of Computer Science, Monash University, Australia 3168

----------------------------------------------------------------------

 
 
 

1. vxworks header files vs. unix header files

I am compiling many modules for a vxworks application, and these
modules use sockets, time structures, and many, many things defined in
the standard Unix header files (struct tm, struct hostent, and on and on).

Several reliable and experienced vxworks users have told me not to use
unix header files, and should use only vxworks header files.  The
problem is, the vxworks header files do not define all of the
"standard" things found in unix files.

How is this problem handled?  Do I hunt through all the unix header
files, seeking out each and every vx-absent definition and copying it
to my own header file?

Is there some "foo.h" out there that defines all the vx-absent structs
and types?
--

2. cdd3610

3. VIM: How to open an header file with a source file

4. Optimization problems with AXP VMS Fortran v6.1

5. Accessing user mode user mode header files(.h) files in the driver.

6. unable to add packages to gpo's in ad

7. FS:Circuit Board Header 1,700-1,800 pices McKennzie Headers 050-1X20-881S

8. Big Exchange w/SBS

9. I need s2asm.sed for mcc-2.1.4

10. Wanted s2asm program

11. Bug in mpx+s2asm+tasm

12. s2asm --- dos2out bug

13. s2asm --- .s to .asm conversion