This chapter describes the simple binary output module which can be
selected with the @option{-Fvobj} option.

@section Legal

    This module is written in 2002-2025 by Volker Barthelmann
    and is covered by the vasm copyright without modifications.

@section Additional options for this module
@table @option
    @item -vobj2
        Use vobj format version 2 which generally reduces file size.
    @item -vobj3
        Version 3 supports absolute section addresses and indirect symbols.
@end table


@section General

This output module outputs the @code{vobj} object format, a simple
portable proprietary object file format of @code{vasm}.

The Format is defined as follows:

@example

Header
  .byte 0x56,0x4f,0x42,0x4a
  .byte flags
    Bits 0-1:
     1: BIGENDIAN
     2: LITTLENDIAN
    Bits 2-7:
     VOBJ-Version (0-based)
  .number bitsperbyte 
  .number bytespertaddr
  .string cpu
  .number nsections [1-based]
  .number nsymbols [1-based]
  
nsymbols
  .string name
  .number type
  .number flags
  .number secindex
  .number val
  .number size

nsections
  .string name
  .string attr
  .number flags
  .number address (entry is present with version 3+ and flags&ABSOLUTE only)
  .number align
  .number size
  .number nrelocs
  .number databytes
  .byte[databytes]

nrelocs [standard|special]
standard
   .number type
   .number byteoffset
   .number bitoffset
   .number size
   .number mask
   .number addend
   .number symbolindex | 0 (sectionbase)

special
    .number type
    .number size
    .byte[size]

.number:[taddr]
    .byte 0--127 [0--127]
    .byte 128-191 [x-0x80 bytes little-endian], fill remaining with 0
    .byte 192-255 [x-0xC0 bytes little-endian], fill remaining with 0xff
    (.byte 192-255 is supported by vobj version 2+ only.)
@end example

@section Restrictions

None.

@section Known Problems

    Some known problems of this module at the moment:

@itemize @minus

@item None.

@end itemize

@section Error Messages

This module has the following error messages:
@itemize @minus
@item 3010: section <%s>: alignment padding (%lu) not a multiple of %lu at 0x%llx
@item 3026: output module requires option -vobj3 to support indirect symbols
@end itemize
