You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to figure out how to build register banks into my SLEIGH definition for RL78, and honestly I can't figure out a way to make that happen without creating a colossal mess. Basically, register banks work by setting 2 bits (Register Bank Select 0/1, aka RBS0/RBS1) in the Program Status Word (PSW) register. I know that context variables could be used to allow me to define 4 constructors like:
attach variables [bank0] [X A C B E D L H];
attach variables [bank1] [X1 A1 C1 B1 E1 D1 L1 H1];
attach variables [bank2] [X2 A2 C2 B2 E2 D2 L2 H2];
attach variables [bank3] [X3 A3 C3 B3 E3 D3 L3 H3];
Reg1: bank0 is banksel=0 & bank0 {export bank0;}
Reg1: bank1 is banksel=1 & bank1 {export bank1;}
Reg1: bank2 is banksel=2 & bank2 {export bank2;}
Reg1: bank3 is banksel=3 & bank3 {export bank3;}
But this becomes an issue quickly as I'd also need to define one of these for each register that's accessed uniquely, one for each register lookup mode that uses a different attachment path (there are 5 attachment paths in my current bank-less definition), etc. This explodes rapidly.
Is there a way to instead do something like:
regA: A is banksel=0 & A {export A;}
regA: A1 is banksel=1 & A1 {export A1;}
regA: A2 is banksel=2 & A2 {export A2;}
regA: A3 is banksel=3 & A3 {export A3;}
regX: [4x definitions]
regC: [4x definitions]
...
attach constructors [opcode_reg_b0_2] [regX regA regC regB regE regD regL regH];
so that the constructors are accessed and activated based off their index into the list? Or is the messier "just define everything and bit the bullet" the only way to go about this?
This discussion was converted from issue #796 on March 21, 2023 14:44.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey guys,
I'm trying to figure out how to build register banks into my SLEIGH definition for RL78, and honestly I can't figure out a way to make that happen without creating a colossal mess. Basically, register banks work by setting 2 bits (Register Bank Select 0/1, aka RBS0/RBS1) in the Program Status Word (PSW) register. I know that context variables could be used to allow me to define 4 constructors like:
But this becomes an issue quickly as I'd also need to define one of these for each register that's accessed uniquely, one for each register lookup mode that uses a different attachment path (there are 5 attachment paths in my current bank-less definition), etc. This explodes rapidly.
Is there a way to instead do something like:
so that the constructors are accessed and activated based off their index into the list? Or is the messier "just define everything and bit the bullet" the only way to go about this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions