Getting Started with M1750 Ada: Ada 95 Compilation System for Spacecraft Microprocessors | ||
---|---|---|
Prev | Appendix C. M1750 Assembler Options and Directives | Next |
In addition to the opcodes specified in the M1750 Standard, the assembler supports several new ones. These are called pseudo opcodes.
The 1750 does not have the important load register instruction for extended precision floating point. The reason is we can copy a three-word extended floating point value from one triple register to another using a single load register and a double load register. However, if the source triple and destination triples overlap, then it is important to get the single and double load in the correct order otherwise the source will be overwritten before it is completely copied.
The opcode EFLR is translated by the assembler into either a single load followed by a double load, or a double load followed by a single load, depending on which registers are used, and guarantees correct operation.
Note that the condition codes will not be correctly set by EFLR. To set the condition codes you should do an extended compare with zero. Of course to check whether a number is negative or not, no matter whether it is a 16 bit, 32 bit or 48 bit, fixed or floating, you only have to test the sign bit of the first word.
There are two macro-like instructions, LSJS and LURS, for supporting subprogram call and return across address states. Normally these will be translated by the assembler into SJS and URS instructions, but if the assembler is run with the expanded memory option -Along-calls then LSJS is expended into a sequence of instructions that makes a call to a subprogram that may be in a different address state and uses the BEX 0 instruction. The LURS instruction is converted into a BEX 2 instruction.
The instruction LLIM is used to load a long (24-bit) byte address into a pair of registers. The address can then be used in the 1750B long load and store instructions, such as LSL and LSS.
Certain pseudo opcodes are permitted for branch instructions. They expand to the shortest branch instruction that can reach the target address. Generally these mnemonics are made by substituting "j" for "b" at the start of a standard 1750 mnemonic.
The following table summarizes the pseudo-operations for branches.
All the MIL-STD-1750A and 1750B XIO commands are supported. They may be used in both XIO and VIO instructions.
BIT | ITGI | RDOW | RPS |
CC | LMP | RFMK | RSW |
CI | LOS | RFR | RXMP |
CLC | LXMP | RIC1 | SFMK |
CLIR | MPEN | RIC2 | SFR |
CO | OD | RIPR | SMK |
DMAD | OTA | RLP | SPI |
DMAE | OTAR | RMFA | TAH |
DSBL | OTB | RMFP | TAS |
DSUR | OTBR | RMFS | TBH |
ENBL | OTGR | RMK | TBS |
ESUR | PI | RMP | TPIO |
GO | PO | RNS | WIPR |
ICW | RCFR | ROPR | WOPR |
ITA | RCS | ROS | WPBS |
ITAR | RCW | RPBS | WSW |
ITB | RDI | RPI | |
ITBR | RDOR | RPIR |
You may write XIO instructions in Ada using the predefined package Machine_Code, as in the following example: