EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

lst.htm
Class
LST
Encodings
LstEnc
Procedures
LstBoolean
LstCreate
LstGetFileName
LstSet

Listing is a plain text file with two columns where EuroAssembler logs its activity. See also manual.


lst PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=32
 INCLUDEHEAD "euroasm.htm" ; Interface (structures, symbols and macros) of other modules.
lst HEAD ; Start of module interface.
↑ LST
Object Lst represents the source listing, i.e. the text file with two columns:
  1. hexadecimal dump of emitted machine code
  2. copy of source text

Dump lines may be accompanied with expanded lines, diagnostic and error messages.
The object Lst is allocated statically as a part of object Src.

The listing line is compiled by procedure StmListing.

LST STRUC
.Stream        D D ; ^STREAM of the listing file contents.
.SetBuffer     D D ; ^BUFFER for %variable contents presented in dump column.
.Section       D D ; ^SSS with current section used in listing.
.Status        D D ; Flags in LstEncoding which control the listing. LSB contains character used as separator.
  ENDSTRUC LST
↑ LstEnc
Encoding of flags used in LST.Status:
  
lstSeparator   EQU 0x000000FF ; Mask of separating character in end-dump column: | ! + - *
lstNoList      EQU 0x00010000 ; Do not list current statement.
lstNoData      EQU 0x00020000 ; Dump column contains no data.
lstTRUE        EQU 0x00040000 ; Dump the token TRUE  to listing Data column instead of emitted data.
lstFALSE       EQU 0x00080000 ; Dump the token FALSE to listing Data column instead of emitted data.
lstNothingExp  EQU 0x00100000 ; Nothing to expand, Stm.ExpBuffer doesn't differ from Stm.SrcBuffer, or LISTVAR=OFF.
lstSet         EQU 0x00200000 ; Dump .SetBuffer as hexa instead of emitted data. Set by LstSet.
lstAsRepeated  EQU 0x00400000 ; Use '+' as lstSeparator for this statement.
lstExpSrc      EQU 0x00800000 ; Expanded source is listed. Supress offset if no more dump bytes.
lstSectInline  EQU 0x01000000 ; [sect] in dump column is on the same line as SEGMENT,STRUC,[Sect] statement.
lstSectKeep    EQU 0x02000000 ; Do not display [sect] change in dump column.
lstLiteral     EQU 0x04000000 ; Dump as literal, use '=' as lstSeparator.
lstEQU         EQU 0x08000000 ; Dump Stm.Offset as numeric symbol value instead of address.
lstEnvelope    EQU 0x10000000 ; Use space as lstSeparator for this statement, which is envelope PROGRAM/ENDPROGRAM.
lstListOn      EQU 0x20000000 ; List this statement even when EUROASM LIST=OFF.
lstTilde       EQU 0x80000000 ; ~ as the last char in dump column indicates that not all dump bytes were listed.
lstVolMask     EQU 0xFFFF0000 ; Volatile flags. Set in PseudoHandlers, reset in StmListing.
 ENDHEAD lst ; End of module interface.
↑ LstCreate
LstCreate will initialize the Src.Lst object and create its buffers.
Input
-
Output
-
Invoked by
SrcCreate
LstCreate Procedure
     LEA EBX,[Src::+SRC.Lst]
     MOV EDX,[Src.Pool::]
     StreamCreate EDX,BufSize=32K
     MOV [EBX+LST.Stream],EAX
     BufferCreate EDX,Size=2K
     MOV [EBX+LST.SetBuffer],EAX
     SUB EAX,EAX
     MOV [EBX+LST.Status],EAX
     MOV [EBX+LST.Section],EAX
    EndProcedure LstCreate
↑ LstSet DataPtr, DataSize
LstSet stores Data to Lst.SetBuffer and flags lstSet. This indicates that Data should be presented as hexa in dump column during StmListing.
Used in execution of SET* statements.
Input
DataPtr Data contents of preprocessing %variable.
DataSize Number of bytes in Data.
Output
Data will be stored in Src.Lst.SetBuffer and Src.Lst.Status:lstSet.
Error
-
Invoked by
PseudoEQU PseudopcFOR PseudopcSET PseudopcSET2 PseudopcSETA PseudopcSETB PseudopcSETC PseudopcSETE PseudopcSETL PseudopcSETS PseudopcSETX
Tested by
t2810
LstSet Procedure DataPtr, DataSize
      MOV EDI,Src::+SRC.Lst
      MOV EBX,[EDI+LST.SetBuffer]
      BufferClear EBX
      BufferStore EBX,[%DataPtr],[%DataSize]
      SetSt [EDI+LST.Status],lstSet
     EndProcedure LstSet
↑ LstBoolean
Procedure LstBoolean will set lstTRUE or lstFALSE flag in LST.Status. Listing of this statement will display boolean value in dump column.
Input
CF=0, ZF=0 to set lstTRUE
CF=0, ZF=1 to set lstFALSE.
Output
EAX=lstFALSE or lstTRUE. Other registers and flags are preserved.
Error
-
Example
Invoke ExpEvalBoolOp1, EBX Invoke LstBoolean
Invoked by
PseudopcELSE PseudopcENDREPEAT PseudopcIF PseudopcWHILE
Tested by
t2600 t2602
LstBoolean Procedure
     PUSHFD
      JC .90:
      MOV EAX,lstFALSE
      JZ .50:
      MOV EAX,lstTRUE
 .50: SetSt [Src.Lst::+LST.Status],EAX
 .90:POPFD
     EndProcedure LstBoolean
↑ LstGetFileName
Procedure LstGetFileName will return listing file name. The name is specified either explicitly with option EUROASM LISTFILE=, or it is constructed from source file name appended with extension .lst.
Input
-
Output
ESI= is pointer to listing file name (volatile)
ECX= is filename size.
Error
E8020 Filename "!1$" is too long.
Invoked by
SrcDestroy VarExpand
Invokes
EaBufferRelease EaBufferReserve
LstGetFileName Procedure
     MOV ECX,[Ea::+EA.Eaopt+EAOPT.ListFileSize]
     MOV ESI,[Ea::+EA.Eaopt.ListFilePtr]
     TEST ECX
     JNZ .80: ; If explicitly specified with LISTFILE= option.
     ; Otherwise use the default "%^SourceName%^SourceExt.lst".
     LEA EBX,[Ea.SrcFile.Name::] ; Pointer to zero-terminated filename.
     GetLength$ EBX ; EBX,ECX now specifies source file name.
     Invoke EaBufferReserve::,LstGetFileName
     BufferStore EAX,EBX,ECX
     BufferStore EAX,=B".lst",5
     BufferRetrieve EAX
     Invoke EaBufferRelease::,EAX
     DEC ECX
     CMP ECX,MAX_PATH_SIZE
     JNA .80:
     Msg '8020',ESI ; Filename "!1$" is too long.
     MOV ECX,MAX_PATH_SIZE
 .80:MOV [%ReturnESI],ESI
     MOV [%ReturnECX],ECX
  EndProcedure LstGetFileName
 ENDPROGRAM lst

▲Back to the top▲