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

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [macros/] [storeramminus.py] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sinclairrf
# Copyright 2014, Sinclair R.F., Inc.
2
 
3
def storeramminus(ad):
4
  """
5
  Built-in macro for the store- instruction where the memory is specified by
6
  the variable name instead of the memory name.\n
7
  Usage:
8
    .storeram-(variable)
9
  where
10
    variable    is a variable\n
11
  The effect is:  RAM[T] = N
12
                  T = T-1
13
                  N = next in stack\n
14
  ( u_mem u_addr - u_addr-1 )
15
  """
16
 
17
  # Add the macro to the list of recognized macros.
18
  ad.AddMacro('.storeram-', 1, [ ['','symbol'] ]);
19
 
20
  # Define the macro functionality.
21
  def emitFunction(ad,fp,argument):
22
    (addr,ixBank,bankName) = ad.Emit_GetAddrAndBank(argument[0]);
23
    emitString = 'store-(%s) -- %s' % (bankName,argument[0]['value'],);
24
    ad.EmitOpcode(fp,ad.specialInstructions['store-'] | ixBank,emitString);
25
 
26
  ad.EmitFunction['.storeram-'] = emitFunction;

powered by: WebSVN 2.1.0

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