Welcome

ASOLMS40 Assembler

rainbow

   The  OKI  OLMS-40  series of microprocessors has a unique in-
struction set in which all registers and addressing are inherent
to  the  individual  instructions.   Thus  there  is no explicit
register set nor  any  addressing  modes.   The  internal  4-bit
registers are the Accumulator (A), and registers W, X, Y, and Z.
The 8-bit memory pointer DP is accessible by lower nibble as DPL
and upper nibble DPH.  

rainbow

MICROPROCESSOR SELECTION 


   The  selection of one of the four OLMS-40 supported micropro-
cessor types is achieved by adding one of  these  directives  at
the beginning of the assembly source file:  

        .msm5840        MSM5840  Microprocessor
        .msm5842        MSM5842  Microprocessor
        .msm58421       MSM58421 Microprocessor
        .msm58422       MSM58422 Microprocessor

MSM58421  and MSM58422 have identical cores with differing peri-
pherals.  

   The  variable .__.CPU.  generated by the assembler will indi-
cated  the  microprocessor  selection  with  the  value   of   0
(MSM5840), 1 (MSM5842), 2 (MSM58421), or 3 (MSM58422).  

rainbow

OLMS-40 INSTRUCTION SET 


   The  instruction set can be broken up into several categories
with common traits.  


Load, Store, Read, and Clear 

        CLA             Clear Accumulator
        CLL             Clear DPL
        CLH             Clear DPH
        LAI     #4-bit  Load Accumulator with Immediate
        LLI     #4-bit  Load DPL with Immediate
       %LHI     #1-bit  Load DPH with Immediate
        LHI     #3-bit  Load DPH with Immediate
        L               Load Accumulator with Memory
       *LM      #2-bit  Load Accumulator with Memory
                          then Modify DPH
        LAL             Load Accumulator wit DPL
        LLA             Load DPL with Accumulator
        LAW             Load Accumulator with W Register
       *LAX             Load Accumulator with X Register
       *LAY             Load Accumulator with Y Register
       *LAZ             Load Accumulator with Z Register
        SI              Save Accumulator to Memory
                          then increment DPL
       *SMI     #2-bit  Save Accumulator to Memory
                          then Modify DPH and increment DPL
        LWA             Load W Register with Accumulator
       *LXA             Load X Register with Accumulator
       *LYA             Load Y Register with Accumulator
       *LZA             Load Z Register with Accumulator
        LPA             Load Port Pointer with Accumulator
      $%LTI             Load Timer with All Zeros
       *LTI     #8-bit  Load Timer with Immediate
       *RTH             Read Timer H
       *RTL             Read Timer L

       * - MSM5840 Specific Instruction
       % - MSM5842 Specific Instruction
       $ - MSM58421 and MSM58422 Specific Instruction

rainbow

Exchange 


   Several  'SAVE  REGISTERS',  A, AX, L and CH, facilitate tem-
porary register storage:  

       *XA      Exchange Accumulator with Save Register A
       *XAX     Exchange Accumulator with Save Register AX
       *XL      Exchange DPL with Save Register L
       *XCH     Exchange DPH and Carry with Save Register CH
        X       Exchange Accumulator with Memory

       *XM      #2-bit  Exchange Accumulator with Memory
                          then Modify DPH

       * - MSM5840 Specific Instruction

rainbow

Increment 

      $%INA             Increment Accumulator
      $%INL             Increment DPL
      $%INM             Increment Memory
      $%INW             Increment W Register
       *INA             Increment Accumulator - Skip If Zero
       *INL             Increment DPL         - Skip If Zero
       *INM             Increment Memory      - Skip If Zero
       *INW             Increment W Register  - Skip If Zero
       *INX             Increment X Register  - Skip If Zero
       *INY             Increment Y Register  - Skip If Zero
       *INZ             Increment Z Register  - Skip If Zero

       * - MSM5840 Specific Instruction
       % - MSM5842 Specific Instruction
       $ - MSM58421 and MSM58422 Specific Instruction

rainbow

Decrement 

      $%DCA             Decrement Accumulator
      $%DCL             Decrement DPL
      $%DCM             Decrement Memory
       *DCA             Decrement Accumulator - Skip If Zero
       *DCL             Decrement DPL         - Skip If Zero
       *DCM             Decrement Memory      - Skip If Zero
       *DCW             Decrement W Register  - Skip If Zero
       *DCX             Decrement X Register  - Skip If Zero
       *DCY             Decrement Y Register  - Skip If Zero
       *DCZ             Decrement Z Register  - Skip If Zero
       *DCH             Decrement DPH - Skip if all 1's and C=0

       * - MSM5840 Specific Instruction
       % - MSM5842 Specific Instruction
       $ - MSM58421 and MSM58422 Specific Instruction

rainbow

Logical 

        CAO             Complement Accumulator of One
       *AND             And Accumulator with Memory
       *OR              Or Accumulator with Memory
       *EOR             Exclusive Or Accumulator with Memory
        RAL             Rotate Accumulator Left Through Carry

       * - MSM5840 Specific Instruction

rainbow

Arithmetic 

        AC              Add Memory to Accumulator with Carry
       *ACS             Add Memory to Accumulator with Carry,
                          Skip if Carry
        AS              Add Memory to Accumulator,
                          Skip if Carry
        AIS     #4-bit  Add Immediate to Accumulator,
                          Skip if Carry
        DAS             Decimal adjust Accumulator
                          in Subtraction
       $CM              Compare Accumulator with Memory
      %*CM              Compare Accumulator with Memory,
                          Skip if Equal
       *AWS             Add W Register to Accumulator,
                          Skip if Carry
       *AXS             Add X Register to Accumulator,
                          Skip if Carry
       *AYS             Add Y Register to Accumulator,
                          Skip if Carry
       *AZS             Add Z Register to Accumulator,
                          Skip if Carry

       * - MSM5840 Specific Instruction
       % - MSM5842 Specific Instruction
       $ - MSM58421 and MSM58422 Specific Instruction

rainbow

Bit Set, Reset, and Test 

       *SPB     #2-bit  Set Port Bit
       *RPB     #2-bit  Reset Port Bit
        SMB     #2-bit  Set Memory Bit
        RMB     #2-bit  Rest Memory Bit
      $%TAB     #2-bit  Test Acumulator Bit
      $%TMB     #2-bit  Test Memory Bit
       $THB             Test H Port Bit
      $%TTM             Test Timer Flag
      $%TC              Test Carry Flag
       *TAB     #2-bit  Test Acumulator Bit, Skip if One
       *TMB     #2-bit  Test Memory Bit, Skip if One
       *TKB     #2-bit  Test K Port Bit, Skip if One
      %*THB     #1-bit  Test H Port Bit, Skip if One
       *TI              Test Interrupt Flag, Skip if One
       *TTM             Test Timer Flag, Skip if One
       *TC              Test Carry Flag, Skip if One
        SC              Set Carry Flag
        RC              Reset Carry Flag

       * - MSM5840 Specific Instruction
       % - MSM5842 Specific Instruction
       $ - MSM58421 and MSM58422 Specific Instruction

rainbow

Branch and Subroutine 

       %J       10-bit  Jump
      $*J       11-bit  Jump
        JC      6-bit   Jump in Current Page
        JA              Jump with Accumulator
       %CAL     10-bit  Call Subroutine
      $*CAL     11-bit  Call Subroutine
        RT              Return from Subroutine

       * - MSM5840 Specific Instruction
       % - MSM5842 Specific Instruction
       $ - MSM58421 and MSM58422 Specific Instruction

rainbow

Input and Output 

       *OBS             Output Byte String
        OTD             Output Table Data
        OA              Output Accumulator to Port A
        OB              Output Accumulator to Port B
        OP              Output Accumulator to Port P
                          designated Port Pointer
       *OAB             Output Memory and Accumulator
                          to Ports a and b
        OPM             Output Memory to Port P
                          designated Port Pointer
        IA              Input Port A into Accumulator
        IB              Input Port B into Accumulator
        IK              Input Port K into Accumulator
       *IAB             Input Ports A and B
                          into Memory and Accumulator

       * - MSM5840 Specific Instruction

rainbow

Control 

       *EI              Enable Interrupt
       *DI              Disable Interrupt
       *ET              Enable Timer
       *DT              Disable Timer
       *ECT             Enable Counter
       *DCT             Disable Counter
       *HLT             Halt
       *EXP             Exchange Program
        NOP             No Operation

       * - MSM5840 Specific Instruction

Go to the Documentation Index
rainbow

spaceship ... Exit the ASxxxx Documentation

home ... Home Page

Last Updated: July 2026