OpenCores
URL https://opencores.org/ocsvn/ssbcc/ssbcc/trunk

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [macros/] [storeram.py] - Rev 11

Go to most recent revision | Compare with Previous | Blame | View Log

# Copyright 2014, Sinclair R.F., Inc.
 
def storeram(ad):
  """
  Built-in macro for the store instruction where the memory is specified by the
  variable name instead of the memory name.\n
  Usage:
    .storeram(variable)
  where
    variable    is a variable\n
  The effect is:  RAM[T] = N
                  T = N
                  N = next in stack\n
  ( u_mem u_addr - u_mem )
  """
 
  # Add the macro to the list of recognized macros.
  ad.AddMacro('.storeram', 1, [ ['','symbol'] ]);
 
  # Define the macro functionality.
  def emitFunction(ad,fp,argument):
    (addr,ixBank,bankName) = ad.Emit_GetAddrAndBank(argument[0]);
    emitString = 'store(%s) -- %s' % (bankName,argument[0]['value'],);
    ad.EmitOpcode(fp,ad.specialInstructions['store'] | ixBank,emitString);
 
  ad.EmitFunction['.storeram'] = emitFunction;
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.