24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>FORTRAN</strong> Statements<br />

2.60 MAP Statement<br />

MAP<br />

The MAP statement is used in conjunction with the END MAP declarative statement. The MAP statement<br />

marks the start of a memory mapping structure. A MAP structure must appear within a UNION block. Any<br />

number of variables of any type may appear within a memory map. At least two MAP structures must<br />

appear within a UNION block. A UNION block permits the mapping of the same storage in several<br />

different ways.<br />

The following example maps out a 4-byte integer on an Intel 80x86-based processor.<br />

Example:<br />

STRUCTURE /MAPINT/<br />

UNION<br />

MAP<br />

INTEGER*4 LONG<br />

END MAP<br />

MAP<br />

INTEGER*2 LO_WORD<br />

INTEGER*2 HI_WORD<br />

END MAP<br />

MAP<br />

INTEGER*1 BYTE_0<br />

INTEGER*1 BYTE_1<br />

INTEGER*1 BYTE_2<br />

INTEGER*1 BYTE_3<br />

END MAP<br />

END UNION<br />

END STRUCTURE<br />

RECORD /MAPINT/ I<br />

I%LONG = ’01020304’x<br />

PRINT ’(2Z4)’, I%LO_WORD, I%HI_WORD<br />

END<br />

For more information, see the chapter entitled "Structures, Unions and Records" on page 167.<br />

MAP Statement 107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!