mirror of
https://github.com/elliotnunn/mac-rom.git
synced 2024-12-28 16:31:01 +00:00
4325cdcc78
Resource forks are included only for .rsrc files. These are DeRezzed into their data fork. 'ckid' resources, from the Projector VCS, are not included. The Tools directory, containing mostly junk, is also excluded.
65 lines
1.5 KiB
Plaintext
65 lines
1.5 KiB
Plaintext
;
|
|
; File: EndianAware.a
|
|
;
|
|
; Contains: macros for 68K clients that are aware of platform endian-ness
|
|
;
|
|
; Written by: Craig Prouse
|
|
;
|
|
; Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
|
|
;
|
|
; Change History (most recent first):
|
|
;
|
|
; <1> 11/10/93 fau first checked in
|
|
;
|
|
;
|
|
|
|
IF (&TYPE('__INCLUDINGENDIANAWARE__') = 'UNDEFINED') THEN
|
|
__INCLUDINGENDIANAWARE__ SET 1
|
|
|
|
IF &TYPE('littleEndian') = 'UNDEFINED' THEN
|
|
littleEndian SET 1
|
|
ENDIF
|
|
|
|
|
|
; ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ
|
|
; ENDSW (pseudo-instruction)
|
|
;
|
|
; Operation: (Size = Byte) None
|
|
; (Size = Word) Dn[8:15] <-> Dn[7:0]
|
|
; (Size = Long) Dn[31:24] <-> Dn[7:0]; Dn[23:16] <-> Dn[15:8]
|
|
;
|
|
; Syntax: ENDSW Dn
|
|
;
|
|
; Attributes: Size = (Byte, Word, Long)
|
|
;
|
|
; Description: Exchange bytes within a word or longword to convert between
|
|
; big-endian and little-endian representations.
|
|
;
|
|
; CCR: Undefined
|
|
; ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ
|
|
|
|
MACRO
|
|
ENDSW.&size &Dn
|
|
|
|
IF &UC(&size) = 'L' OR &UC(&size) = 'W' OR &UC(&size) = 'B' OR &size = '' THEN
|
|
|
|
IF littleEndian THEN
|
|
IF &UC(&size) <> 'B' THEN
|
|
rol.w #8,&Dn
|
|
ENDIF ; Size <> Byte
|
|
IF &UC(&size) = 'L' THEN
|
|
swap &Dn
|
|
rol.w #8,&Dn
|
|
ENDIF ; Size = Long
|
|
ENDIF ; littleEndian
|
|
|
|
ELSE
|
|
AERROR (&CONCAT('''',&UC(&size),''' is an invalid operand size for ENDSW'))
|
|
|
|
ENDIF ; Size = B | W | L
|
|
|
|
ENDM
|
|
|
|
|
|
ENDIF ; __INCLUDINGENDIANAWARE__
|