
   YcodeFile 


         YcodeFile     
.        .

offset	 size  	

	       		 YcodeFile      
$0000  2 bytes c0 de		  $c0 $de (code).
	       
$0002  1 byte  10                              ($10)
	       
$0003  1 byte  00             Byte sex (0 - negative).                  ($00)
	       
$0004  2 bytes 01 xx		Version (Major.Minor)    YcodeFile.
	       
$0006  2 bytes 00 00          Unused.   0.               ($0000)
	       
$0008  1 word  20 00		   (32 )   Bsex-
	       
$000a  1 word  00 02		   (512 )   Bsex-
	       
$000c  1 word  xx xx		      
	       		Module Descriptor   .
$000e	       |  U  |		 1.00  codefile   unused  
	       |  n  |		      > 1.00
  .	       |  u  |		   4  8 
  :	       |  s  |		   (  > $80  8bytes)
	       |  e  |
$0017	       |  d  |
	       
$0018  LongWrd  Check Sum 	CheckSum of a file (if MinVer > $80)
	       
$001c  LongWrd  serial No 	serial number (Compiler/Linker/Optimizer)
	       

 Module Descriptor 

 module name 8 chars		  . 8 .

 Ver   (word) 		  (    0 )

Date   (2 bytes)		   ( interface )

Time   (2 bytes)		 (,  ...)  

Next   (word) 		     ModuleDescriptor

Mseg   (word) 		     

Lang   (2 bytes)		    .

Cstrt  (word) 		  .   
 			interface . (Block No)
Csize  (word) 		  .  
 			interface . (in bytes)
Usage  (word) 		Offset of first paragraph in usage list

     

     

Ne	 (byte) 		   (/units/)

Ni	 (byte) 		   ( )


: ,          interface.
     :     X,    
 (    )       
 
    
                  
           .
     ,      -   
     ,         -   
               .
              
          .

Language:            :

     : 0 -  (native code)
 				      1 - Pascal.
       .
  

X Yx y


      $0000  .

     $01xx -    MC6800 native code
	  $02xx -    MCS6502 native code

     $1Xxx -    Pascal.

     $2Xxx -    Modula-2.


 HiByte LowByte   Date:        


   	     day	 (1..31)   (5 bits)
   	  month	 (1..12)   (4 bits)
    year - 1980 (0..127)  (7 bits)


 HiByte LowByte     Time:        


   	     sec / 2 (0..29)	(5 bits)
   	  min     (0..59)	(6 bits)
    hour    (0..23)	(5 bits)

 Usage Paragraph 

 module name 8 chars		  . 8 .

 Ver   (word) 		  (    0 )

Date   (2 bytes)		   ( interface )

Time   (2 bytes)		 (,  ...)  

Next   (word) 		     UsageParagraph

      \
  \
        \
    \
          \
      \
            \
        >		unused now
            /
      /
          /
    /
        /
  /
      /


 Segment Descriptor 


 segment name 8 chars		  . 8 .   
	     .
Start  (word) 		Start block of a code segment

Size   (word) 		Size in bytes of a code segment

No     (word) 		Segment No (0 for main)

Next   (word) 		Next Segment (pragraph No)

     

     

     

     

     

     

     

     


    

	      
	      	       
	      		  	     | 
	      			 V		  V	     | V

 Segment Header  Ycode for Procedures  ProcDictionary  ConstPool  RelTbl 

		   ^	^      ^	   	   		     | cut this
		   	        ...  		     |	after
		   		   		     relocation
		   

=== Segment Header Info (32 ) ===


 segment name 8 chars		  . 8 .  
	    .
10	 (byte) 		     (16)

00	 (byte) 		byte sex (0 - negative)

01.00  (2 bytes)		Ycode version (major.minor)

Tsize  (word) 		Total size (in bytes   32  header),
 			 +   ConstPool
Csize  (word) 		Const Pool size. (in bytes)

|  .  | 			10  () 
|  :  |

Relct  (word) 		Pointer to Relocation Tables

Pdict  (word) 		Pointer to ProcDictionary

CPool  (word) 		Pointer to Const Pool


       ProcDictionary, ConstPool  
      .        
   .

=== ProcDictionary ===

	  
N 0 p1 p2 ...  pn
	  
 ^    ^   ^	   ^
      ...  offset       
    

=== ConstPool ===
     .

=== RelTbl (Relocation table) ===

  Relocation table    relocate-  
 (MC6800 ).       .
      obj     , 
     0        . 
         .  
        .. Nitems.

:        relocate  ,
	         .


=== Procedure ===

  
  |    exit code of a procedure 	|
>|  exit:				|
| |    Ycode of a procedure.		|
| |					|
 
exit  (word) ExitPtr:       exit   .
  
  Psize (word) ParamSize:     .
  
  Dsize (word) DataSize:     . ( Params)
  
  Lx	(byte) LexLevel:    .
  	 ------------------------------------------------------------------
  No	(byte) ProcNo:   :     
  		             
		         0     
		          .   :
		         (   )    $00
		              .



   SYM  


	       
$0000 10 bytes  U  n  i  P  a	s  c  a  l 00 
	       
$000a  2 bytes 01 xx			         SYM  
	       
$000c  4 bytes  serial No 		       compiler's serial number
	       
$0010  8 bytes  module name 8 chars   
	       
$0018  2 bytes  Ver 	(word)
	       
$001a  2 bytes Date 	(2 bytes)
	       
$001c  2 bytes Time 	(2 bytes)
	       
$001e  2 bytes dsize	(word)		       size of interfaced variables
	       
$0020  1 byte  0x			       x = 0/1 (interface/
	       					interface only) unit
$0021  1 byte  nn			       nn = number of external units
	       
       8 bytes  module name 8 chars      \
	          |
       2 bytes  Ver 	(word)		    \	     
	       			     >	 UNIT (),
       2 bytes Date 	(2 bytes)	    /	  unit STANDARD.
	       			   |
       2 bytes Time 	(2 bytes)	   /
	       
$0022  2 bytes Csize			       Interfaced const pool size
	       
	      /|     |			       Large constants itself (Cpool)
       Csize < |     |			       size in bytes = Csize
	      \
	       |  |			       Forward definitions
	       |  |			       for all exported type Idents
	       |  |
	       
	       FF			         $FF
	       
	       |  |			       Dump of all identifiers
	       |  |
	       
	       FF			         $FF
	       
	       |  |			       Type definitions
	       |  |			       for all exported types
	       |  |
	       
	       $ffff				  $ffff
	       

