World: r3wp
[rebcode] Rebcode discussion
older newer | first last |
Steeve 23-Feb-2007 [1932x3] | fortunatly :) |
my interpreter will be faster if any math operations could act on char (one byte) | |
and if more flags was handled | |
BrianH 23-Feb-2007 [1935] | That isn't always the case with modern processors - some work faster with integers. I agree on the flags though, in your case. |
Steeve 23-Feb-2007 [1936x5] | could the T flag be set after a locial operation like AND ? |
very usefull to test if a bit is set | |
*after a logical operation | |
for example, if i want to test the 7th bit , i do and var 128 ift [ do the job] | |
instead of doing and var 128 eq.i var 128 ift [ do the job] | |
BrianH 23-Feb-2007 [1941] | Whae does SETT do here? |
Steeve 23-Feb-2007 [1942x2] | sett ? |
you mean | |
BrianH 23-Feb-2007 [1944] | It sets the T flag based on the contents of a variable. I think it sets T to false if the var has 0, none or false, and sets T to true otherwise. |
Steeve 23-Feb-2007 [1945] | and var 128 sett var ift [do the job] |
BrianH 23-Feb-2007 [1946x2] | Yeah. |
Try it. My memory of the behavior of SETT on 0 is a little sparse. | |
Steeve 23-Feb-2007 [1948] | i don't see any gain |
BrianH 23-Feb-2007 [1949] | It would be faster than a compare. |
Steeve 23-Feb-2007 [1950x4] | i use 3 instructions to test a bit in all cases |
should have: bit 7 [do the job] | |
:-) | |
missing the operand | |
BrianH 23-Feb-2007 [1954] | I'm curious, did you check SETT to see if the value 0 sets the T flag to false? |
Steeve 23-Feb-2007 [1955x3] | no sorry , i test now |
it works | |
anyway it's not really a problem, i never perform such tests | |
BrianH 23-Feb-2007 [1958x2] | Cool. So SETT can replace ZERO? and NONE?, which otherwise don't have rebcode equivalents. |
Or rather NOT ZERO? and NOT NONE?, but the effect is the same. | |
Steeve 23-Feb-2007 [1960x2] | i don't understand usage of ext8 and ext16 |
perhaps, they should be usefull for me | |
BrianH 23-Feb-2007 [1962x2] | Sign extension, so that you can use signed arithmetic on integers that contain values retrieved from 8 or 16 bit data. |
It's so you don't have to do arithmetic on bytes. | |
Steeve 23-Feb-2007 [1964x5] | hum i see |
i think i should replace this: | |
gt.i decal 127 ift [sub.i decal 256] | |
by this: ext8 decal | |
eureka !!!! | |
BrianH 23-Feb-2007 [1969] | Looks like. |
Steeve 23-Feb-2007 [1970x2] | thi code is the macro i use the most |
*is in the macro | |
BrianH 23-Feb-2007 [1972] | I wonder how much other code generated by your macros could be optimized... |
Steeve 23-Feb-2007 [1973x3] | not as much as that |
i hope | |
but surely some of them | |
BrianH 23-Feb-2007 [1976x3] | Perhaps some of those and x 255 operations could be put off until the value is written to memory. |
While the values are in the registers, who cares what precision they are internally. | |
It would make the C flag easy to keep track of. Perhaps some of the multibyte operation sequences could be combined. | |
Steeve 23-Feb-2007 [1979] | hum |
BrianH 23-Feb-2007 [1980] | Where it matters you could replicate the overflow behavior on purpose. |
Steeve 23-Feb-2007 [1981] | but you see, the 8bit registers are often combined into 16bits registers, so i should perform AND 255 before to translate them into 16 bit, i'm not sure there is a real gain |
older newer | first last |