URL
https://opencores.org/ocsvn/ssbcc/ssbcc/trunk
[/] [ssbcc/] [trunk/] [core/] [9x8/] [macros/] [fetchvalue.py] - Diff between revs 3 and 5
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 3 |
Rev 5 |
Line 15... |
Line 15... |
# Add the macro to the list of recognized macros.
|
# Add the macro to the list of recognized macros.
|
ad.AddMacro('.fetchvalue', 2, [ ['','symbol'] ]);
|
ad.AddMacro('.fetchvalue', 2, [ ['','symbol'] ]);
|
|
|
# Define the macro functionality.
|
# Define the macro functionality.
|
def emitFunction(ad,fp,argument):
|
def emitFunction(ad,fp,argument):
|
variableName = argument[0]['value'];
|
(addr,ixBank,bankName) = ad.Emit_GetAddrAndBank(argument[0]);
|
(addr,ixBank,bankName) = ad.Emit_GetAddrAndBank(variableName);
|
ad.EmitPush(fp,addr,ad.Emit_String(argument[0]['value']),argument[0]['loc']);
|
ad.EmitPush(fp,addr,ad.Emit_String(variableName),argument[0]['loc']);
|
|
ad.EmitOpcode(fp,ad.specialInstructions['fetch'] | ixBank,'fetch '+bankName);
|
ad.EmitOpcode(fp,ad.specialInstructions['fetch'] | ixBank,'fetch '+bankName);
|
|
|
ad.EmitFunction['.fetchvalue'] = emitFunction;
|
ad.EmitFunction['.fetchvalue'] = emitFunction;
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.