It is currently Sun Oct 22, 2017 10:20 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Sun Feb 01, 2015 4:35 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 936
I only worked with that of UE1 anyway.


Top
 Profile  
 
PostPosted: Sun Feb 01, 2015 5:20 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3471
Location: Indianapolis
I remember seeing some source code to something by Color Dreams, I couldn't find it online today but I did have it saved on my computer. I only have this one "yourcode.asm" file which is obviously incomplete, but it has 4300 lines of code/script that all looks like this:

Code:
DUDEMAKE:
   .DRW   DUMMY,MAKER
   .DB   0,-1,0,0,0

MAKER:
;FIRST DO A WHOLE BUNCH 'O CRAP...

   .DB   INSTRUCTIONS,22
   .DB   GRAVITY,0
   .DB   DISSCROLL,UP|DOWN

   .DB   SETREG,0,0
   .DB   STORE,50    ;ZERO HAND COUNT
   .DB   STORE,51   ;ZERO COUNTER
   .DB   STORE,25   ;ZERO GOAL COUNT
   .DB   STORE,53    ;ZERO SAVED COUNT
   .DB   STORE,55   ;ZERO LAUNCH COUNT

   .DB   WRITEVID
   .DRW   SCORES
   .DB   15,1,0,5
   .DB   WRITEVID
   .DRW   CAUGHT
   .DB   19,1,0,6
   .DB   WRITEVID
   .DRW   HANDTEXT
   .DB   23,1,0,5
   .DB   GETHEROS,JOY1
   .DB   SHOWREG,24,1,0
   .DB   WRITEVID
   .DRW   TIME
   .DB   15,26,0,5
   .DB   WRITEVID
   .DRW   SAVED
   .DB   19,26,0,5
   .DB   LOAD,53
   .DB   SHOWREG,20,26,0      ;PRINT OUT NUMBER SAVED (ZERO)
   .DB   WRITEVID   ;PRINT OUT "QUOTA" AND RESPECTIVE NUMBER
   .DRW   GOAL
   .DB   23,26,0,5
   .DB   FETCHREG,PARAM2
   .DB   STORE,25
   .DB   SHOWREG,24,26,0


Top
 Profile  
 
PostPosted: Sun Feb 01, 2015 11:36 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
rainwarrior wrote:
(I only have experience with UE3, by the way. I can't comment on UE4.)

UE4 is C++ all the way, and some sort of visual scripting thingy ("blueprints" they call it) thrown on top.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sun Feb 01, 2015 11:39 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3074
Location: Nacogdoches, Texas
Sweet Jesus, how many languages are there! What even warrants so many different ones?


Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 2:36 am 
Offline

Joined: Mon Apr 07, 2008 6:08 pm
Posts: 325
Location: Missouri
Final Fantasy Legend II on GB uses a BASIC-like interpreted language (Someone confirmed with hacking).

http://www.gamefaqs.com/boards/585710-f ... i/41541049


Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 5:56 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7234
Location: Chexbres, VD, Switzerland
Apparently, interpreted bytecode is quite common, so it's not surprising I wrote my own system using interpreted bytecode to save ROM (as opposed to 6502 native code).

Quote:
Final Fantasy Legend II on GB uses a BASIC-like interpreted language (Someone confirmed with hacking).

This bugs me. How can they know the language looked like BASIC before compilation, if all they can see is the resulting bytecode ? This makes not much sense. It could any other language, really.


Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 10:34 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
BASIC was usually compiled to some form of "pseudo-bytecode" where the opcodes are not instructions to be run as-is but rather the tokens making up each instruction (so e.g. LET A = B + 2 would be stored as 6 tokens) - sorta like a makeshift compression scheme. If the bytecode looks something like this then it's usually safe to assume the language must have been BASIC-like, at least in how it worked.


Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 1:06 pm 
Offline

Joined: Tue May 26, 2009 5:39 am
Posts: 19
Memblers wrote:
I remember seeing some source code to something by Color Dreams, I couldn't find it online today but I did have it saved on my computer. I only have this one "yourcode.asm" file ...

you can find it in this archive. but there are many other sources on the site.


Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 1:59 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
Sik wrote:
BASIC was usually compiled to some form of "pseudo-bytecode" where the opcodes are not instructions to be run as-is but rather the tokens making up each instruction (so e.g. LET A = B + 2 would be stored as 6 tokens) - sorta like a makeshift compression scheme. If the bytecode looks something like this then it's usually safe to assume the language must have been BASIC-like, at least in how it worked.


What makes something BASIC-like? How would, say, an interpreted LISP subset look different at the bytecode level?

Consider these two claims:
1. "Here's a BASIC-like language I constructed to represent what these bytecodes are doing."
2. "A BASIC-like language was used to construct these bytecodes."

The first one is easy to make. The second I think is a lot harder.

I expect most bytecodes look something like: Function opcode, followed by the required number of parameter codes, possibly with recursive expansion on parameters, repeat. Alternatively, instead of recursive expansion, the compiler could expand/unwind the parameters itself. More or less any programming language can be compiled down to something like this. There's nothing unique about BASIC in this respect.


Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 9:09 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
In most cases bytecode is basically similar to CPU instruction sets on their own, so for example you have operations like load, store, add, substract, compare, etc. BASIC usually gets tokenized instead, where the source code is stored as tokens to save space (so you have stuff like print, input, let, etc., i.e. higher level instructions). Basically just take the different parts making up a sentence and encode them into something more compact than plain text (in theory you should even be able to recover something akin to the original source code from this as well, this is exactly what the LIST command in old computers did in fact).

Every language can be handled both ways, but since tokenization was something done mostly with BASIC, it's safe to assume it was probably something similar to BASIC when that method is used. Now, if the bytecode resembles more CPU instructions, yeah the assumption is pretty stupid.


Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 10:17 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 936
I'm reminded that Earthbound had most of its stuff in its dialogue-scripting language. Past a certain point, if you want varying functionalities, you pretty much have to have your own language; while some RPGs just have "I can do this and this and this with these probabilities of each" others allow more complicated control structures. Final Fantasy 6's enemy scripts are pretty-well documented, for instance.
Espozo wrote:
Sweet Jesus, how many languages are there! What even warrants so many different ones?

There are thousands of computer programming languages. These are listed in various ways:

Of course, their main list doesn't include kind intentionally designed to screw with your head

There are many, many reasons to have different programming languages. Machine code is instructions to processors (which depends on what said processor can do); assembly languages (in broad strokes) are human-readable.

One can focus on making programs correspond simply to what the computer does, just automating simple tasks. Or, one can focus on corresponding simply to results, automating far more things.

BASIC (and its hundreds of dialects) and Logo were designed to be easy-to-learn. (Logo also has the operation of a particular kind of drawing robot in mind, but this is optional.)

Fortran was basically designed for numeric computation.

Verilog and other Hardware Description Languages are for...well, describing what you want an integrated circuit to do.

One might design a language to operate your (new) tools. One might design a language so that nobody else knows it and stealing your code doesn't help spies if they can't also get the compiler.
One might design a language to compete and lure others to buy your products from other languages, yet make it so they can't readily go back; perhaps also make it not run on other platforms for monopolizing power.

One might design languages for automating I/O processing, including tokenizing of strings and matching to regular expressions (which are, of course, their own kind of language).
Quote:
tokenization was something done mostly with BASIC,
I think you'll have to unpack that a little.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 1:35 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7234
Location: Chexbres, VD, Switzerland
Sik wrote:
In most cases bytecode is basically similar to CPU instruction sets on their own, so for example you have operations like load, store, add, substract, compare, etc. BASIC usually gets tokenized instead, where the source code is stored as tokens to save space (so you have stuff like print, input, let, etc., i.e. higher level instructions). Basically just take the different parts making up a sentence and encode them into something more compact than plain text (in theory you should even be able to recover something akin to the original source code from this as well, this is exactly what the LIST command in old computers did in fact).

I think you are confusing two completely different things : Tokenized source code and bytecode. I am by no means a specialist, however tokenized source code is not bytecode ! It is just a compressed source code, where a token is replaced by a single byte, for the sole purpose of saving memory. The comments for example are still here and intact, and the variable and function names are also present in RAW format.

Bytecode on the other hand can take many different forms but in most case it will be low-level instructions, where the comments are removed and there is no plain text anymore, the comments, the variables and functions names are gone, they are replaced by addresses or offsets.

Thus a "BASIC-like bytecode" is not possible, either it is a bytecode that comes from an unknown language, or it is tokenized BASIC where all variable and function names are apparent (the comments might have been removed for the release though).

Quote:
Verilog and other Hardware Description Languages are for...well, describing what you want an integrated circuit to do.

This is probably controversial, but in my opinion Hardware Description Languages are not programming languages (although they look similar) : They are not written to describe programs, but hardware. The verification / test bench part of them could be considered a programming language, though.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 2:12 am 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 936
You may not have a program on the resultant FPGA/what have you, but the Verilog is/is used to
googled program definitions wrote:
n. 4. a series of coded software instructions to control the operation of a computer or other machine.
v. 1. provide (a computer or other machine) with coded instructions for the automatic performance of a particular task.
It at least is a set of "do-this-when-that" that gets boiled down to instructions to the device to "connect-this-to-that" and "fill-this-LUT-with-that" etc...

Mind, this loosely-defined, staff music is a programming language, as is English (for you can write the programme of the evening's entertainment with it...)

I'll agree that Verilog is probably not a language you can use to make the computer you wrote it on perform arbitrary operations.
Quote:
Thus a "BASIC-like bytecode" is not possible, either it is a bytecode that comes from an unknown language, or it is tokenized BASIC where all variable and function names are apparent
Dictionary-indexing of names seems like a sensible lossless size-reducing option; why would this be any less sensible to do for the arbitrary variable/function(/subroutine/label) names than for the fixed instruction and operator names? Aren't both of them necessary steps for executing the program anyway?


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 3:18 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7234
Location: Chexbres, VD, Switzerland
Quote:
Dictionary-indexing of names seems like a sensible lossless size-reducing option; why would this be any less sensible to do for the arbitrary variable/function(/subroutine/label) names than for the fixed instruction and operator names? Aren't both of them necessary steps for executing the program anyway?

I said I wasn't an expert, some variants of tokenized BASIC more advanced than C64's could very well do that, but then the variable's and function's names have to be present at least once in order to retrieve the original source code exactly like it was, when running "LIST" for instance.

The point is that tokenized BASIC has a 1:1 relationship with the original sourcecode, whether a compiled bytecode does not.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 10:04 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Bregalad wrote:
Sik wrote:
In most cases bytecode is basically similar to CPU instruction sets on their own, so for example you have operations like load, store, add, substract, compare, etc. BASIC usually gets tokenized instead, where the source code is stored as tokens to save space (so you have stuff like print, input, let, etc., i.e. higher level instructions). Basically just take the different parts making up a sentence and encode them into something more compact than plain text (in theory you should even be able to recover something akin to the original source code from this as well, this is exactly what the LIST command in old computers did in fact).

I think you are confusing two completely different things : Tokenized source code and bytecode. I am by no means a specialist, however tokenized source code is not bytecode ! It is just a compressed source code, where a token is replaced by a single byte, for the sole purpose of saving memory. The comments for example are still here and intact, and the variable and function names are also present in RAW format.

Bytecode on the other hand can take many different forms but in most case it will be low-level instructions, where the comments are removed and there is no plain text anymore, the comments, the variables and functions names are gone, they are replaced by addresses or offsets.

Thus a "BASIC-like bytecode" is not possible, either it is a bytecode that comes from an unknown language, or it is tokenized BASIC where all variable and function names are apparent (the comments might have been removed for the release though).

You're making the assumption the original quote didn't also use the wrong term as well (I keep saying "bytecode" to stay consistent with what has been mentioned before).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group