Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / My attempt at a simple programming language

Author
Message
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Aug 2003 20:09
Quote: "
Ok, so does that mean that a linker is what writes the HEADER to the new file?
"

Yeah among other things like.. erm.. linking (as explained in one of my first posts).


Quote: "
And what commands in DBPro would be used to write HEX...Byte...Dword...Word?
"

WRITE BYTE, WRITE WORD and WRITE LONG

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 6th Aug 2003 20:11
Ahh...the linker is the think that tells it what DLL to use for a basic structure...i still dont get it...whats the linker do, it really doesnt specify more than it connects the program thats being compiled to the Kernal32.DLL..

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Aug 2003 20:26 Edited at: 6th Aug 2003 20:28
On a common C or Pascal system the compiler compiles the source to object files (described in one of my prev. posts). If you have a project with more than one source (includes) then they're separately compiled each to object files . Now the linker links these files to one exe, is responsible for the the import table, and of course the header. Roughly.

Don't get me wrong here, I would like to help you more but this stuff is far too big for a forum thread.
It'd be far easier for you to understand all this if you go through a good Assembly tutorial.
You'll get a good understanding what CPUs do and how Windows is involved and so on.

Or ask Raven because he wrote "LumaBasic"

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 6th Aug 2003 20:56
RAVEN!!! whats lumabasic...

Thanks Empty i found a really good set of PDFs and i get how it works now...it was on assembly and linkers and linrarians or sumthin...i get it...the processor and such and how the different families use machine code to dictate how the variables and math is stored and calculated...and the linker links all of the viable libraries of functions and write the header and then includes all the rest of the sources at the order they are called...and the parts of the header include where to start what platform the program runs on, resources and all the information and how major parts of the program such as where the pointer is placed at start where the resources are an so on...but man i wish i knew more...lol...i think i have the basics from here and i learned alot from my journy into the google search...though i cant figure out how the friggin variables work but oh well...i still figued the move commands and stuff and the if and such though i am curious if thats part of the assembler and not the OPCODES...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 6th Aug 2003 22:30
So wait i can write the hex out in bytes words and long?...i thought i could just write like F5 or sumthin...how do i know what to write...gimme links to a tutorial on HEXADECIMALS...i dont get hexadecimals...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 7th Aug 2003 00:16
WHOA, OMG it just clicked...empty and raven...when you learned about all of the real ways computers work did it just sorta hit you like computing nirvana to the point your eyes open real big and you start to map how drivers interface with the kernal to the opcodes to the port of a printer so that the printer gets the information and stores it into memory and recievs its own set of OPCODES specified by the drivers to tell it to print what to print and how to print it...whoa...its like i know how computers really work...whoa...its like computer nirvana...whoa...i am freaking out...this is creepy...

is it supposed to hit me like this...

oh and by the way a parse table is what tells the compiler what commands, that are part of the high level language, should become when written into the sections after the header as opcodes in sequences of HEX or binary such a JMPEGS(not a real command i know) but it says that the command "FAKE" when compiled should run like JMP then it should EGS right after with whatever parameters are called and such is added...and as for the HEXADECIMALS they are written as a byte or word depending of the contents such as "F5" is a word and "10102020303FF" is a long and a byte is like "1", so a parse table will look up the commands and then write a long or a word and add the bytes or other words that are variables to the language like the parameters of a function...whoa...man...

so is it like "welcome to the divine world of computer Brother Eddie...welcome to the order of the Computers"...whoa...this is so weird its like i know how a computer works down to the mechanical level...whoa...creepy...

I bet in DBPro i can use Arrays saved as libraries for the parse tables set it like



or sumthin similar except optomised to work quicker IE not the OPCODES just what to write...that way i can add libraries to it without having to write DLLs...thats so freaky...whoa...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 7th Aug 2003 02:00
Quote: "
RAVEN!!! whats lumabasic...
"

LOL, yeah I wanna know this too (just somehow I doubt it exists).


Anyway, I see you're getting into it. That's good, yet it's a long way ahead (unfortunately).

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 7th Aug 2003 03:33
Lumabasic? Sounds interesting. (Another sneak peek at Raven't site, I couldn't find anything. )

@Raven

How's the website going? I hope it gets finished soon so I can read more about 7DP.




Website 50% done (May be out by mid-end August)
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 7th Aug 2003 16:34
Yeah, i got into it and realized i meant Binary when i said HEX...lol...a byte is 1,0 a word is 11,10,01,00 a long is 1111,1110,1100,1000,0000,0111,0011,0001,0100,0010 and i think alot of OPCODES use a couple of longs...though i still cant find a good pointer tutorial thing...other than that its pretty simple after you link the parse tables and write the PE HEADER...quite interesting...parse, parse, parse...a high level language, such as basic, has its commands derived from machine code, OPCODES, ASM, X86 or whatever you like to call it...these commands are really just combinations of the assembly languages code to create function like we use in DarkBasic...these functions handle things such as memory and the interface between the software and any hardware it may used, though thats normally bridged through driver or the kernal...the PE HEADER is like a set of assembly codes(though its not really) that tell the Kernal what system this will operate on and what resources it will use such as icons and bimaps, it also contains the binary adress of any stored files or information needed that has its own section of the code...no matter what i am gonna have to write in binary...though HEX may look nicer...and a parse table is actually pretty simple to make it can be generated through an array like a spreadsheet containing the assembly code of the command...and the PE HEADER would be different depending on the computer the application was meant to run...so the linker will look at the main project file that contains the information such as version info and what processors it was meant to run on and even what version of the operating system the application can use...then once that has been linked into the file the actual process of writing the code in its OPCODE form...the header also specifies where the pointer(or the thing that dictates where the program begins) goes if ts not just gonna start right at the begining right after the header...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 7th Aug 2003 17:14
whats faster an interpretive language or a true machine code language in terms of running speed not creation of the compiler...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 7th Aug 2003 18:40 Edited at: 7th Aug 2003 19:41
Quote: "
whats faster an interpretive language or a true machine code language in terms of running speed not creation of the compiler...
"

Generally a program compiled to machine code would be faster than an interpreted language. But it heavily depends on the programmer's skills (the programmer that writes the compiler/interpreter).

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 7th Aug 2003 20:13
Well, thats cool...im gonna write a compiler for a simple language...i started to write the parse tables last night...but i didnt know where to start in terms of core commands...know any links about the basic structure of any language in the assembled for throught the OPCODES after its been parsed and any links on where to find a tutorial on creating them or tricks to them...and i still cant find a link on what OPCODES do what, its becoming quite a pain...

lol, but i know the ultimate link that can answer my questions...

[href]www.google.com[/href]

so i am gonna go there to look for now...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 17th Aug 2003 22:04
can i write a hex digit to a file using the byte command because A-F are string digits...and i dont have access to Bits which is the 0100 so what do i write...binary in the bytes words and longs or hex into them?

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Aug 2003 14:05 Edited at: 21st Aug 2003 14:18
I managed to get a simple programming language to work with code like this:



which would print "David is 99 years old".

If you want the code then I'll post it. It'd only 445 lines.

Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 22nd Aug 2003 22:40
Yeah post it...i wanna see how it works...is it in DB(Pro)?...and i still cant figure out if i write the 0s and 1s with bytes since i cant write at the bit level or if i can somehow write HEX into it...

Help...

I still cant find a good tutorial on how to use the opcodes or even just basic principles of use...anyone know...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd Aug 2003 14:03
It's DBPro. It's not a "proper" language as such it does not compile just interprets each line put in. Accepted commands are:

- DIM $varname AS [STRING / INTEGER / REAL]
- PRINT You text +$includedvar +$anothervar more text
- SHOW ALL VARS - dumps list of variables to screen for debugging
- $varname = [VALUE]
- rem COMMENT
- ` COMMENT



There's no place like 127.0.0.1

There are 10 people in this world, those who understand binary and those who don't.

Login to post a reply

Server time is: 2024-04-23 07:30:16
Your offset time is: 2024-04-23 07:30:16