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

Subversion Repositories ssbcc

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

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

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

powered by: WebSVN 2.1.0

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