The LazyBoy Library Manual - Write

Part of the Text Writer group.

%imacro Write 0-*
Prefers: label

Write a series of text strings or numbers to the output device. If an error occurs during output, IO_ERROR will be updated with the error code.

Assumed unless otherwise specified:

  • Simple labels are ASCIIZ strings locations in CS.
  • Memory references without segments are ASCIIZ strings in DS.
  • Registers and register pairs are numbers of their bit size.
  • Numbers are signed integers.
  • Constant numbers will be the minimum bit size for the value.

Data type overrides:

CHARoutput as ASCII character
BINoutput as binary
HEXoutput as hexadecimal
UINToutput as unsigned integer
SINToutput as signed integer

Data bit sizes:

BYTEdata is a 8-bit value
WORDdata is a 16-bit value
DWORDdata is a 32-bit value
QWORDdata is a 64-bit value
TWORDdata is a 80-bit value
OWORDdata is a 128-bit value
YWORDdata is a 256-bit value
ZWORDdata is a 512-bit value

More rules:

  • The order is always [TYPE] [SIZE] DATA
  • Constant strings must not have any TYPE or SIZE information.
  • Memory References to numbers require SIZE information.
Examples:
    ; write the constant string to the output device
    Write "Hello, World!"

    ; write the string stored at CS:HI_WORLD to the output device
    Write HI_WORLD

    ; write a hex value followed by a string and preceeded by "0x"
    Write "0x", hex AX, " bytes"

    ; miscellaneous examples
    Write char [ES:SI]

    Write sint qword [SI]

    Write PREFIX_TEXT, hex yword [SI], "->", \
        char AL, "/", [DI], " ", uint dword [VALUE_X], "+", DX, " bytes"

See also WriteAssign, WriteLn, IO_ERROR