|  | 
   
 |   |  |   
  
    | RGBASM(1) | FreeBSD General Commands Manual | RGBASM(1) |  
rgbasm— Game Boy
    assembler
 
  
    | rgbasm | [ -EhVvw] [-bchars] [-Dname[=value]]
      [-gchars]
      [-Ipath]
      [-Mdepend_file]
      [-MG] [-MP]
      [-MTtarget_file]
      [-MQtarget_file]
      [-oout_file]
      [-Pinclude_file]
      [-ppad_value]
      [-Qfix_precision]
      [-rrecursion_depth]
      [-sfeatures:state_file]
      [-Wwarning]
      [-Xmax_errors]
      asmfile |  The rgbasmprogram creates an RGB object
    file from an assembly source file. The object file format is documented in
    rgbds(5). The input asmfile can be a path to a file,
    or -to read from standard input. Note that options can be abbreviated as long as the abbreviation
    is unambiguous: --verbis--verbose, but--veris
    invalid because it could also be--version. The
    arguments are as follows: 
  -bchars,--binary-digitscharsChange the two characters used for binary constants. The defaults are
    01.-Dname[=value],--definename[=value]Add a string symbol to the compiled source code. This is equivalent to
      ‘name
      ’
      in code, or ‘EQUS"value"name
      ’ if
      value is not specified.EQUS"1"-E,--export-allExport all labels, including unreferenced and local labels.-gchars,--gfx-charscharsChange the four characters used for gfx constants. The defaults are
    0123.-h,--helpPrint help text for the program and exit.-Ipath,--includepathAdd a new “include path”; path must
      point to a directory. When a INCLUDE(including
      the implicit one from-P) orINCBINis attempted,rgbasmfirst looks up the provided path from its
      working directory; if this fails, it tries again from each of the
      “include path” directories, in the order they were
    provided.-Mdepend_file,--dependfiledepend_fileWrite
      make(1)
      dependencies to depend_file.-MGTo be used in conjunction with -M. This makesrgbasmassume that missing files are
      auto-generated: whenINCLUDE(including the
      implicit one from-P) orINCBINis attempted on a non-existent file, it is
      added as a dependency, thenrgbasmexits normally
      instead of erroring out. This feature is used in automatic updating of
      makefiles.-MPWhen enabled, this causes a phony target to be added for each dependency
      other than the main file. This prevents
      make(1)
      from erroring out when dependency files are deleted.-MTtarget_fileAdd a target to the rules emitted by -M. The exact
      string provided will be written, including spaces and special characters.is equivalent to-MTfileA-MTfileB
 . If neither this nor-MT'fileA fileB'
 -MQis specified, the output
      file name is used.-MQtarget_fileSame as -MT, but additionally escapes any special
      make(1)
      characters, essentially ‘$’.-oout_file,--outputout_fileWrite an object file to the given filename.-Pinclude_file,--preincludeinclude_filePre-include a file. This acts as if a
      ‘’ was read
      before the input asmfile.INCLUDE"include_file"-ppad_value,--pad-valuepad_valueUse this as the value for DSdirectives in ROM
      sections, unless overridden. The default is 0x00.-Qfix_precision,--q-precisionfix_precisionUse this as the precision of fixed-point numbers after the decimal point,
      unless they specify their own precision. The default is 16, so fixed-point
      numbers are Q16.16 (since they are 32-bit integers). The argument may
      start with a ‘.’ to match the Q
      notation, for example, ‘’.-Q.16-rrecursion_depth,--recursion-depthrecursion_depthSpecifies the recursion depth past which rgbasmwill assume being in an infinite loop. The default is 64.-sfeatures:state_file,--statefeatures:state_fileWrite the specified features to
      state_file, based on the final state of
      rgbasmat the end of its input. The expected
      features are a comma-separated subset of the
      following:
      equWrite all numeric constants as
          ‘’.defnameequvaluevarWrite all variables as
          ‘’.defname=valueequsWrite all string constants as
          ‘’.defnameequs"value"charWrite all characters as
          ‘’.charmapname,
          valuemacroWrite all macros as
          ‘’.macroname ...endmallActs like equ,var,equs,char,macro. This flag may be specified multiple times with different
        feature subsets to write them to different files (see
        EXAMPLES below).-V,--versionPrint the version of the program and exit.-v,--verboseBe verbose.-Wwarning,--warningwarningSet warning flag warning. A warning message will be
      printed if warning is an unknown warning flag. See
      the DIAGNOSTICS section for a list
      of warnings.-wDisable all warning output, even when turned into errors.-Xmax_errors,--max-errorsmax_errorsIf more than this number of errors (not warnings) occur, then abort the
      assembly process; -X0
      disables this behavior. The default is 100 ifrgbasmis printing errors to a terminal, and 0
      otherwise. Warnings are diagnostic messages that indicate possibly erroneous
    behavior that does not necessarily compromise the assembling process. The
    following options alter the way warnings are processed. 
  -WerrorMake all warnings into errors. This can be negated as
      -Wno-errorto prevent turning all warnings into
      errors.-Werror=Make the specified warning or meta warning into an error. A warning's name
      is appended (example: -Werror=obsolete), and this
      warning is implicitly enabled and turned into an error. This can be
      negated as-Wno-error=to prevent turning a
      specified warning into an error, even if-Werroris in effect. The following warnings are “meta” warnings, that
    enable a collection of other warnings. If a specific warning is toggled via
    a meta flag and a specific one, the more specific one takes priority. The
    position on the command-line acts as a tie breaker, the last one taking
    effect. 
  -WallThis enables warnings that are likely to indicate an error or undesired
      behavior, and that can easily be fixed.This enables extra warnings that are less likely to pose a problem, but
      that may still be wanted.-WeverythingEnables literally every warning. The following warnings are actual warning flags; with each
    description, the corresponding warning flag is included. Note that each of
    these flag also has a negation (for example,
    -Wcharmap-redefenables the warning that-Wno-charmap-redefdisables; and-Wallenables every warning that-Wno-alldisables). Only the non-default flag is
    listed here. Ignoring the “no-” prefix, entries are listed
    alphabetically. 
  -Wno-assertWarn when WARN-type
      assertions fail. (See “Aborting the assembly process” in
      rgbasm(5)
      forASSERT).-Wbackwards-forWarn when FORloops have their start and stop
      values switched according to the step value. This warning is enabled by-Wall.-Wbuiltin-argsWarn about incorrect arguments to built-in functions, such as
      STRSUB() with indexes outside of the string's
      bounds. This warning is enabled by-Wall.-Wcharmap-redefWarn when re-defining a charmap mapping. This warning is enabled by
      -Wall.-WdivWarn when dividing the smallest negative integer (-2**31) by -1, which
      yields itself due to integer overflow.-Wempty-macro-argWarn when a macro argument is empty. This warning is enabled by
      -Wextra.-Wempty-strrplWarn when STRRPL() is called with an empty string
      as its second argument (the substring to replace). This warning is enabled
      by-Wall.-Wlarge-constantWarn when a constant too large to fit in a signed 32-bit integer is
      encountered. This warning is enabled by
    -Wall.-Wmacro-shiftWarn when shifting macro arguments past their limits. This warning is
      enabled by -Wextra.Warn when the block comment start sequence
      ‘/*’ is found inside of a block
      comment. Block comments cannot be nested, so the first
      ‘*/’ will end the whole
    comment.-Wno-obsoleteWarn when obsolete constructs such as the _PIconstant orPRINTTdirective are encountered.-Wnumeric-string=Warn when a multi-character string is treated as a number.
      -Wnumeric-string=0or-Wno-numeric-stringdisables this warning.-Wnumeric-string=1or just-Wnumeric-stringwarns about strings longer than
      four characters, since four or fewer characters fit within a 32-bit
      integer.-Wnumeric-string=2warns about any
      multi-character string.-Wpurge=Warn when purging symbols which are likely to have been necessary.
      -Wpurge=0or-Wno-purgedisables this warning.-Wpurge=1or just-Wpurgewarns when purging any exported symbol
      (regardless of type).-Wpurge=2also warns when
      purging any label (even if not exported).-WshiftWarn when shifting right a negative value. Use a division by 2**N
    instead.-Wshift-amountWarn when a shift's operand is negative or greater than 32.-Wtruncation=Warn when an implicit truncation (for example, dbto an 8-bit value) loses some bits.-Wtruncation=0or-Wno-truncationdisables this warning.-Wtruncation=1warns when an N-bit value is 2**N
      or greater, or less than -2**N.-Wtruncation=2or
      just-Wtruncationalso warns when an N-bit value
      is less than -2**(N-1), which will not fit in two's complement
    encoding.-Wunmapped-char=Warn when a character goes through charmap conversion but has no defined
      mapping. -Wunmapped-char=0or-Wno-unmapped-chardisables this warning.-Wunmapped-char=1or just-Wunmapped-charonly warns if the active charmap
      is not empty.-Wunmapped-char=2warns if the
      active charmap is empty, and/or is not the default charmap
      ‘main’.-Wunmatched-directiveWarn when a PUSHC,PUSHO,
      orPUSHSdirective does not have a correspondingPOPC,POPO, orPOPS. This warning is enabled by-Wextra.-Wunterminated-loadWarn when a LOADblock is not terminated by anENDL. This warning is enabled by-Wextra.-Wno-userWarn when the WARNbuilt-in is executed. (See
      “Aborting the assembly process” in
      rgbasm(5)
      forWARN). You can assemble a source file in two ways. Straightforward way: $ rgbasm -o bar.o
  foo.asm
 Pipes way: $ cat foo.asm | rgbasm -o bar.o
  -
 $ rgbasm -o bar.o - <
  foo.asm
 The resulting object file is not yet a usable ROM image—it
    must first be run through
    rgblink(1)
    and then
    rgbfix(1). Writing the final assembler state to a file: $ rgbasm -s all:state.dump.asm
  foo.asm
 Or to multiple files: $ rgbasm -s equ,var:numbers.dump.asm
  -s equs:strings.dump.asm foo.asm
 rgbasmwas originally written by
    Carsten Sørensen as part of the ASMotor
    package, and was later repackaged in RGBDS by Justin
    Lloyd. It is now maintained by a number of contributors at
    https://github.com/gbdev/rgbds.
 
  Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc.
 |