r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[rebcode] Rebcode discussion

[unknown: 10]
15-May-2007
[2268]
Aaaaaiiiii that 1350042 version is a real old one ..but it has Rebcode.....
BrianH
15-May-2007
[2269x3]
Geomol, those OS X versions predate the Great Renaming, so most of 
the opcodes are different.
Ditto with the Linux version, Rebolinth.
The Great Renaming happened with 1.3.60 - look for versions later 
than that.
[unknown: 10]
15-May-2007
[2272]
yes i spotted that...but linux does not go further then December 
2006 unfortuneatly.. I think i have to deal with Rebcode thats limited 
on linux..at least I have someting that does assembly ;-)
Geomol
15-May-2007
[2273]
Yeah, the OSX version, I use (which must be very close to the Linux 
version), is mainly for testing performance and playing around. Not 
for serious work.
Micha
1-Nov-2007
[2274x4]
o
why this code not work on linux  ?
f: rebcode [][apply j make [ image! 0x0] insert j 1 256 return j 
]
i use rebol2650042
Henrik
1-Nov-2007
[2278]
micha, what exactly does it do? I don' t have access to that version 
right here.
btiffin
1-Nov-2007
[2279x3]
Mich; I'm not real up on rebcode, but I don't think apply can't be 
applied to make.  Apply can't evaluate action! or op! types.  So 
for that part you'd want    m: does [make image! 0x0]  f: rebcode 
[] [apply j m [] return j]


Then; I've never got the series opcodes to work.  insert, change 
... none of those.  mold system/internal/rebcodes/insert makes it 
look like they are not implemented.


So I would    f: rebcode [] [apply j m []  do j [insert j 1]  return 
j]  to get your to work, but with the do it's not going to be rebcode 
speedy.
Sorry ... Micha;
Ok, played.  2.6.50.4.2  version insert takes word! series!  so

m: does [make image! 0x0]  f: rebcode [] [apply j m []  insert j 
[1]  return j]  will assemble and run, but I get a mungled image 
when I try it.   (Can't get the 256 count thingy to assemble)
Oldes
5-Jan-2008
[2282]
How to test 'none value in rebcode?  SETT sets false also for zero 
so I cannot use it:/
Geomol
6-Jan-2008
[2283x4]
type? result value-to-check
That one gets the type and put it in result. And that wasn't what 
you asked, I just realize. :) Let me think...
>> ex: rebcode [/local a][set.i a none eq.i a none ift [print "a 
is none"]]
>> ex
a is none
Above example done under Windows with: REBOL/View 1.3.61.3.1 18-Nov-2005 
Core 2.7.0
Oldes
6-Jan-2008
[2287]
In rebcode none is same like zero so if you want to check value where 
are integers or can be none, than it's not enough. The best way how 
to solve it now is not to use such a logic, or use something like 
this:

   ex: rebcode [a /local r n no][type? r a print r   set n none type? 
   no n  eq.i r no ift [print "a is none"]]

which is quite heavy. Or find out the integer value for each datatype. 
Or is there any better way how to work with value returned by  the 
type? opcode?
Oldes
7-Jan-2008
[2288x2]
type? none is in rebcode integer 28 so to test none value it's possible 
to do:

r: rebcode[a][type? t a  eq.i t 28 ift [print "a is none"]] r none
I found it using this: r: rebcode[][set i 0  set n none type? n n 
while [lt.i i 10000][eq.i i n ift [print i] add.i i 1]] r
Geomol
7-Jan-2008
[2290x2]
I feel, the main goal for rebcode implentation is speed, so it makes 
sense, that none is the same as zero. It would probably hit performance 
a lot, if you had the usual REBOL datatypes in rebcode.
Maybe it's confusing, that rebcode has NONE at all!?
BrianH
7-Jan-2008
[2292]
Maybe it's confusting that something as basic as NONE? doesn't have 
a corresponding opcode.
Geomol
11-Feb-2008
[2293x2]
Ready for some fun?
Here's a MOS 6502 emulator written in rebcode, I made over the last 
few days:
http://www.fys.ku.dk/~niclasen/rebol/language/em6502.r
GiuseppeC
11-Feb-2008
[2295]
Geomol: you are crazy !
Geomol
11-Feb-2008
[2296x3]
And no, you can't play Elite with it! ;)

I made this to test the speed of rebcode. That's my primary goal 
with this. So there is no Operating System stuff of any kind, so 
no I/O for keyboard, joysticks or screen.
Guiseppe: I know! But shhh, don't tell the others!
It's v. 0.9.0, and I didn't call it v. 1.0.0, because it needs some 
more testing, I think. It's GPL license.
GiuseppeC
11-Feb-2008
[2299]
Well, I am at the command prompt, I did a do http://www.fys.ku.dk/~niclasen/rebol/language/em6502.r
and the prompt is here again. What could I do ?
Geomol
11-Feb-2008
[2300]
It require REBOL/view v. 1.3.50. That's the rebcode version, I used, 
because it's the one, that run on most platforms.
Oldes
11-Feb-2008
[2301]
is there any ram file to test with?
GiuseppeC
11-Feb-2008
[2302]
Nothing ! I want to play Last Ninja 3, how could I do this ? :-)
Geomol
11-Feb-2008
[2303x2]
To make a little test:
do http://www.fys.ku.dk/~niclasen/rebol/language/asm6502.r
do http://www.fys.ku.dk/~niclasen/rebol/language/em6502.r
ram: asm6502 "lda #&01 adc #&02"
em6502 ram 0
Those 4 lines do this: load the assembler, load the emulator, call 
the asssembler with a 6502 asm program returning 64kb ram, and finally 
run the program.
Oldes
11-Feb-2008
[2305]
Why you are using the old and slower rebcode version?
Geomol
11-Feb-2008
[2306x2]
Not much to see, but the program ram. To check things, put e.g. print 
lines in the end of the emulator. Like those 2 already in there commented 
out:
print A
print P

which will print the content of the A register and the P (status) 
register.
Oldes, because that's the one I have under OS X.
Oldes
11-Feb-2008
[2308]
how sad:/
Geomol
11-Feb-2008
[2309x2]
I think, we can convert it to the other version with one of (I think) 
Ladislav's scripts.
Yes, there is a script called convert-rc.r by Ladislav Mecir.
Oldes
11-Feb-2008
[2311]
And what's the result of your test, how fast the rebcode is?
Geomol
11-Feb-2008
[2312x2]
I only did very little test so far. I got around 1.5 MHz. The cpu 
(actually a 6512, it seems buth with 6502 instructions) in the BBC 
was 1MHz.
I plan to do more tests in the coming days. Or maybe some of you 
wanna test too!
GiuseppeC
11-Feb-2008
[2314]
Script Error: rebcode has no value
Geomol
11-Feb-2008
[2315x2]
And this is on a 1.2 GHz G4 powerpc on my iBook.
Guiseppe, make sure you run rebol 1.3.50!
GiuseppeC
11-Feb-2008
[2317]
I am running view 2.7.5