(This information is only of interest to programmers who wish to work with the memo links directly.)
For 2-byte links, the byte arrangement of the links in the primary and memo files is identical: low byte, high byte. With 4-byte links, this is not the case. In the primary file, the links are stored in BASIC format: low word, high word. However, in the memo file, the links are stored in AMOSL-M68 format: high word, low word. If you need to use the links within the memo pad in a BASIC program, you'll have to use a routine to swap the low and high words before using them in BASIC computations, and then swap them back again before writing them to the memo file. The following routine demonstrates this:
MAP1 MEMOLINK,B,4
MAP1 BSWAP,B,4
MAP1 BSWPX
MAP2 W1,B,2
MAP2 W2,B,2
MAP1 WX,B,2
MEMOLINK = <link within memo file>
BSWAP = MEMOLINK
CALL BSWAP ! convert to BASIC format
! (low word, high word)
MEMOLINK = BSWAP ! MEMOLINK now in BASIC format
...
BSWAP:
WX = W1 ! swap low and high words of BSWAP
W1 = W2
W2 = WX
return