View unanswered posts | View active topics It is currently Wed Nov 20, 2019 8:48 pm



Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
 TWX Technical Discussion (and decompiling info) 
Author Message
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2255
Location: Oklahoma City, OK 73170 US
Unread post Re: TWX Technical Discussion (and decompiling info)
Shadow wrote:
Isn't possible today, you mean. Anything is possible. :)

There is no current concept of returning a value, that is absolutely correct, but it is not very different from how scripts work today. They are processed in a linear order, yes, but there are gotos and gosubs and branches. Think of what he's asking for as a branch that goes to one place if the "return value" is x or another if it is y. It wouldn't be that hard.

Poor choice of words. I meant it is beyond my understanding for TWX in Delphi.

If I understand what you are saying, the compiler would just create the same byte code. i.e.

Code:
$Param1 = Command $Param2


would still compile the same as:

Code:
Command $Param1 $Param2


Giving TWX a concept of a return value, and then:

Code:
if (Command $Param1 = True)


just becomes shorthand for:

Code:
Command $Result1 $Param1
if $Result1 = True


Using an incriminating name for the $Result in the same way a label is created for waitOn.
It sounds a lot simpler now, but I still don't think I would want to attempt it in Delphi.

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
TeamSpeak3: ts.microblaster.net:9987

Do not try and bend the spoon. That’s impossible.
Instead… only try to realize there is no spoon.


Tue Oct 08, 2019 2:40 pm
Profile ICQ YIM WWW
Lieutenant J.G.

Joined: Mon Dec 01, 2014 5:39 pm
Posts: 342
Unread post Re: TWX Technical Discussion (and decompiling info)
Micro wrote:


Code:
if (Command $Param1 = True)


just becomes shorthand for:

Code:
Command $Result1 $Param1
if $Result1 = True


Using an incriminating name for the $Result in the same way a label is created for waitOn.
It sounds a lot simpler now, but I still don't think I would want to attempt it in Delphi.


yeah, the point of my suggestion is for us programmers ease of programming/readability. So if a function call with return values at compile time = the long hand, that's fine. It's just to make code more concise/easier to use.


Tue Oct 08, 2019 7:52 pm
Profile
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2255
Location: Oklahoma City, OK 73170 US
Unread post Re: TWX Technical Discussion (and decompiling info)
Hammer_2 wrote:
yeah, the point of my suggestion is for us programmers ease of programming/readability. So if a function call with return values at compile time = the long hand, that's fine. It's just to make code more concise/easier to use.

Ultimately it all ends up being assembler code:

Code:
; ----------------------------------------------------------------------------------------
; Writes "Hello, World" to the console using only system calls. Runs on 64-bit Linux only.
; To assemble and run:
;
;     nasm -felf64 hello.asm && ld hello.o && ./a.out
; ----------------------------------------------------------------------------------------

          global    _start

          section   .text
_start:   mov       rax, 1                  ; system call for write
          mov       rdi, 1                  ; file handle 1 is stdout
          mov       rsi, message            ; address of string to output
          mov       rdx, 13                 ; number of bytes
          syscall                           ; invoke operating system to do the write
          mov       rax, 60                 ; system call for exit
          xor       rdi, rdi                ; exit code 0
          syscall                           ; invoke operating system to exit

          section   .data
message:  db        "Hello, World", 10      ; note the newline at the end


Assembler code, or machine language is processor and operating system specific. It is in fact all a processor understands, so everything ends up as simple ones and zeros (I thought I saw a TWO - Bender), memory locations, registers, and a handful of mathematical commands. The processor doesn't even know it is displaying data, as it can only move data from one memory location to another (i.e. the memory of your video card). It was the first language I learned, but I wouldn't want to code in it now :)

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
TeamSpeak3: ts.microblaster.net:9987

Do not try and bend the spoon. That’s impossible.
Instead… only try to realize there is no spoon.


Tue Oct 08, 2019 11:00 pm
Profile ICQ YIM WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1344
Location: Canada
Unread post Re: TWX Technical Discussion (and decompiling info)
Micro wrote:
Assembler code, or machine language is processor and operating system specific. It is in fact all a processor understands, so everything ends up as simple ones and zeros (I thought I saw a TWO - Bender), memory locations, registers, and a handful of mathematical commands. The processor doesn't even know it is displaying data, as it can only move data from one memory location to another (i.e. the memory of your video card). It was the first language I learned, but I wouldn't want to code in it now :)


Ahh. I miss Assembler. Coolest thing I’ve ever done, during an endeavour to create my own OS, was switch my x86 into Protected Mode, and display: “Hello World” (sans INT calls.) ....Microsoft is lucky I got distracted by something shiny. Lol.

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
-= There are 10 types of people in the world: Those that understand Binary and those who do not
-= If Oil is made from Dinosaurs, and Plastic is made from Oil... are plastic Dinosaurs made from real Dinosaurs?
-= I like to keep my friends and my enemies rich, and wait to see which is which - Tony Stark (R.I.P.)


Wed Oct 09, 2019 9:59 am
Profile ICQ YIM
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2255
Location: Oklahoma City, OK 73170 US
Unread post Re: TWX Technical Discussion (and decompiling info)
LoneStar wrote:
Ahh. I miss Assembler. Coolest thing I’ve ever done, during an endeavour to create my own OS, was switch my x86 into Protected Mode, and display: “Hello World” (sans INT calls.) ....Microsoft is lucky I got distracted by something shiny. Lol.

I feel sorry for the guy who wrote MS-DOS, Bill Gates launched an empire off his work, and he got next to nothing for it.

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002
TeamSpeak3: ts.microblaster.net:9987

Do not try and bend the spoon. That’s impossible.
Instead… only try to realize there is no spoon.


Wed Oct 09, 2019 3:00 pm
Profile ICQ YIM WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1344
Location: Canada
Unread post Re: TWX Technical Discussion (and decompiling info)
Micro wrote:
LoneStar wrote:
Ahh. I miss Assembler. Coolest thing I’ve ever done, during an endeavour to create my own OS, was switch my x86 into Protected Mode, and display: “Hello World” (sans INT calls.) ....Microsoft is lucky I got distracted by something shiny. Lol.

I feel sorry for the guy who wrote MS-DOS, Bill Gates launched an empire off his work, and he got next to nothing for it.

Bills only Claim to fame is that he wrote the FAT, which ironically foreshadowed MS’s entire business model: make it work now, fix it over a decade of updates, by gradually incorporating other people’s ideas.

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
-= There are 10 types of people in the world: Those that understand Binary and those who do not
-= If Oil is made from Dinosaurs, and Plastic is made from Oil... are plastic Dinosaurs made from real Dinosaurs?
-= I like to keep my friends and my enemies rich, and wait to see which is which - Tony Stark (R.I.P.)


Thu Oct 10, 2019 9:43 pm
Profile ICQ YIM
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: MSN [Bot] and 0 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.