Update on modules: extracts

Jose E. Marchesi jemarch@gnu.org
Wed Nov 5 23:05:54 GMT 2025


Hello people.

Just a heads up.  The compiler can already generate extracts in the
binary format described by the attached ga68-exports.pk.

Inline below you can see the assembly generated by the compiler for a
bunch of declarations from the standard prelude:

  {
    // XXX
    MOIF_T *moif = a68_moif_new ("somemodule");
    int i = 0;
    for (TAG_T *t = INDICANTS (A68_STANDENV); t != NO_TAG && i++ < 4; FORWARD (t))
      a68_add_indicant_to_moif (moif, t);
    i = 0;
    for (TAG_T *t = IDENTIFIERS (A68_STANDENV); t != NO_TAG && i++ < 4; FORWARD (t))
      a68_add_identifier_to_moif (moif, t);
    i = 0;
    for (TAG_T *t = PRIO (A68_STANDENV); t != NO_TAG && i++ < 4; FORWARD (t))
      a68_add_prio_to_moif (moif, t);
    i = 0;
    for (TAG_T *t = OPERATORS (A68_STANDENV); t != NO_TAG && i++ < 4; FORWARD (t))
      a68_add_operator_to_moif (moif, t);
    a68_asm_output_moif (moif);
  }

The assembly is generated with comments with -dA, and without comments
otherwise.

Salud!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ga68-exports.pk
Type: application/x-tex-pk
Size: 8900 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20251106/9c9b95c5/attachment.bin>
-------------- next part --------------


	.section	.a68_exports,"",@progbits
# MODIF START somemodule
	.value	0x1	# exports version
	.value	0xb	# module name
	.string	"somemodule"
	.value	0x1	# prelude symbol
	.string	""
	.value	0x1	# postlude symbol
	.string	""
	# modes table
	.long	.MTL1-.MTL0	# modes size
.MTL0:
.M0:
	.byte	0x6	# char
.M1:
	.byte	0x9	# string
	.byte	0x1	# flex
	.byte	0x1	# dim
	.long	.M0	# row of char
.M2:
	.byte	0x2	# int
	.byte	0	# sizety
.M3:
	.byte	0x2	# int
	.byte	0x1	# sizety
.M4:
	.byte	0x2	# int
	.byte	0x2	# sizety
.M5:
	.byte	0x2	# int
	.byte	0xff	# sizety
.M6:
	.byte	0x2	# int
	.byte	0xfe	# sizety
.M7:
	.byte	0x3	# real
	.byte	0	# sizety
.M8:
	.byte	0x3	# real
	.byte	0x1	# sizety
.M9:
	.byte	0x3	# real
	.byte	0x2	# sizety
.M10:
	.byte	0xb	# union
	.value	0x8	# nmodes
	.long	.M2	# united mode
	.long	.M3	# united mode
	.long	.M4	# united mode
	.long	.M5	# united mode
	.long	.M6	# united mode
	.long	.M7	# united mode
	.long	.M8	# united mode
	.long	.M9	# united mode
.M11:
	.byte	0xd	# proc
	.long	.M1	# ret mode
	.byte	0x2	# nargs
	.long	.M10	# arg mode
	.value	0x1	# arg name
	.string	""
	.long	.M2	# arg mode
	.value	0x1	# arg name
	.string	""
.M12:
	.byte	0xc	# ref
	.long	.M1	# referred mode
.M13:
	.byte	0xd	# proc
	.long	.M12	# ret mode
	.byte	0x2	# nargs
	.long	.M2	# arg mode
	.value	0x1	# arg name
	.string	""
	.long	.M2	# arg mode
	.value	0x1	# arg name
	.string	""
.M14:
	.byte	0xd	# proc
	.long	.M12	# ret mode
	.byte	0x1	# nargs
	.long	.M2	# arg mode
	.value	0x1	# arg name
	.string	""
.M15:
	.byte	0xd	# proc
	.long	.M0	# ret mode
	.byte	0x1	# nargs
	.long	.M2	# arg mode
	.value	0x1	# arg name
	.string	""
.M16:
	.byte	0	# unknown mode %%<rows%%>
.M17:
	.byte	0xd	# proc
	.long	.M2	# ret mode
	.byte	0x2	# nargs
	.long	.M2	# arg mode
	.value	0x1	# arg name
	.string	""
	.long	.M16	# arg mode
	.value	0x1	# arg name
	.string	""
.M18:
	.byte	0xd	# proc
	.long	.M2	# ret mode
	.byte	0x1	# nargs
	.long	.M16	# arg mode
	.value	0x1	# arg name
	.string	""
.M19:
	.byte	0x4	# bits
	.byte	0x2	# sizety
.M20:
	.byte	0xd	# proc
	.long	.M19	# ret mode
	.byte	0x2	# nargs
	.long	.M19	# arg mode
	.value	0x1	# arg name
	.string	""
	.long	.M19	# arg mode
	.value	0x1	# arg name
	.string	""
.M21:
	.byte	0x4	# bits
	.byte	0x1	# sizety
.M22:
	.byte	0xd	# proc
	.long	.M21	# ret mode
	.byte	0x2	# nargs
	.long	.M21	# arg mode
	.value	0x1	# arg name
	.string	""
	.long	.M21	# arg mode
	.value	0x1	# arg name
	.string	""
.MTL1:
	# extracts table
	.long	.ETL1-.ETL0	# extracts size
.ETL0:
	.long	.EEL0-.EBL0	# extract size
.EBL0:
	.byte	0x1	# identifier extract
	.value	0x6	# name
	.string	"whole"
	.long	.M11	# mode
.EEL0:
	.long	.EEL1-.EBL1	# extract size
.EBL1:
	.byte	0x1	# identifier extract
	.value	0x6	# name
	.string	"fgets"
	.long	.M13	# mode
.EEL1:
	.long	.EEL2-.EBL2	# extract size
.EBL2:
	.byte	0x1	# identifier extract
	.value	0x5	# name
	.string	"gets"
	.long	.M14	# mode
.EEL2:
	.long	.EEL3-.EBL3	# extract size
.EBL3:
	.byte	0x1	# identifier extract
	.value	0x6	# name
	.string	"fgetc"
	.long	.M15	# mode
.EEL3:
	.long	.EEL4-.EBL4	# extract size
.EBL4:
	.byte	0x3	# prio extract
	.value	0x6	# opname
	.string	"ELEMS"
	.byte	0x8	# priority
.EEL4:
	.long	.EEL5-.EBL5	# extract size
.EBL5:
	.byte	0x3	# prio extract
	.value	0x3	# opname
	.string	"+*"
	.byte	0x9	# priority
.EEL5:
	.long	.EEL6-.EBL6	# extract size
.EBL6:
	.byte	0x3	# prio extract
	.value	0x2	# opname
	.string	"I"
	.byte	0x9	# priority
.EEL6:
	.long	.EEL7-.EBL7	# extract size
.EBL7:
	.byte	0x3	# prio extract
	.value	0x4	# opname
	.string	"UPB"
	.byte	0x8	# priority
.EEL7:
	.long	.EEL8-.EBL8	# extract size
.EBL8:
	.byte	0x4	# operator extract
	.value	0x6	# opname
	.string	"ELEMS"
	.long	.M17	# mode
.EEL8:
	.long	.EEL9-.EBL9	# extract size
.EBL9:
	.byte	0x4	# operator extract
	.value	0x6	# opname
	.string	"ELEMS"
	.long	.M18	# mode
.EEL9:
	.long	.EEL10-.EBL10	# extract size
.EBL10:
	.byte	0x4	# operator extract
	.value	0x4	# opname
	.string	"XOR"
	.long	.M20	# mode
.EEL10:
	.long	.EEL11-.EBL11	# extract size
.EBL11:
	.byte	0x4	# operator extract
	.value	0x4	# opname
	.string	"XOR"
	.long	.M22	# mode
.EEL11:
.ETL1:
# MODIF END somemodule


More information about the Algol68 mailing list