Host Engineering Forum

General Category => DirectSOFT => Topic started by: Controls Guy on February 17, 2011, 09:38:08 AM

Title: I-Box guts
Post by: Controls Guy on February 17, 2011, 09:38:08 AM
Is there a reference for what native instructions all the IBoxes compile to?
Title: Re: I-Box guts
Post by: b_carlton on February 17, 2011, 10:24:47 AM
Create a program with, for simplicity, one rung with the IBox you are interested in. Then perform an export to a text file choosing "Expand IBoxes" in the options area.
Title: Re: I-Box guts
Post by: Controls Guy on February 17, 2011, 11:04:00 AM
Thanks.  I'm trying to do things like understand what to expect to find in the accumulator after IBox execution.
Title: Re: I-Box guts
Post by: franji1 on February 17, 2011, 11:19:58 AM
Thanks.  I'm trying to do things like understand what to expect to find in the accumulator after IBox execution.
I know that when you do MATHBIN and MATHBCD, if the result could be bigger than 16 bits, the result is still in the 32-bit accumulator.  So if it's possible that your calculation may be bigger than 9999BCD or 65535binary, just do an OUTD immediately after the MATHBIN/MATHBCD IBox.

LD K5001
OUT V1400
OUT V1401
MATHBCD V2000 "V1400 + V1401"
OUTD V2001

V2000 would equal 2 BCD, but V2001 as a DOUBLE BCD would equal 10002