1. Euphoria RPG
- Posted by Eduardo Uemura Okada <cool at ART.COM.BR> Jul 29, 1997
- 668 views
- Last edited Jul 30, 1997
I wrote here asking for information on Machine language code and RPG in Euphoria. Some was answered (thanks to Einnar Mogen, I'll write again when I start the RPG), but some questions are without answer, this is about the Machine Code Programming Language. If possible, I'd like you Robert Craig, answer this question: Are this Machine Code the Assembler language? This will be very important. Waiting answer... Eduardo Uemura Okada e-mail: cool at art.com.br
2. Re: Euphoria RPG
- Posted by Robert Craig <rds at MSN.COM> Jul 30, 1997
- 636 views
Eduardo Uemura Okada asks: > Are this Machine Code the Assembler language? > This will be very important. Machine Code is the actual numbers that are stored in memory.The Machine (the CPU chip) understands these numbers and can execute them. If you look at euphoria\demo\callmach.ex you'll see: -- String Copy machine code: -- (will move at least one char) string_copy_code = {#50, -- push eax #53, -- push ebx #52, -- push edx #B8} & -- mov eax, int_to_bytes(string_space) & -- string address (source) {#BA} & -- mov edx, int_to_bytes(screen_location) & -- screen address (destination) {#8A, #18, -- L1: mov bl, [eax] #40, -- inc eax #88, #1A, -- mov [edx],bl #83, #C2, #01, -- add edx, #1 #80, #38, #00, -- cmp byte ptr [eax], #00 #75, #F3, -- jne L1 #5A, -- pop edx #5B, -- pop ebx #58, -- pop eax #C3} -- ret -- poke in the machine code: code_space = allocate(length(string_copy_code)) poke(code_space, string_copy_code) -- poke in the string: poke(string_space, string & 0) puts(1, "\n calling machine code routine ... ") -- call the machine code: call(code_space) -- copies string to screen ------------------- The numbers that start with # are the bytes of "machine code". They are shown in hex form because that's the way they are listed in any book on machine code. The first byte is #50, and to the right I've got a comment that says: push eax and to the right of the other hex numbers I have comments as well. In these comments I show the "assembly language" statement that corresponds to the machine code number or numbers. These comments are not necessary. But without them I would quickly forget what the hex numbers mean. In the early days (1940's and 50's), you had to program a computer by entering this machine code. In other words, you had to look up hex codes in a book and load them into the computer's memory. Eventually people got tired of looking up codes in a book, and someone invented a program called an "assembler", and made up a simple language called "assembly language". It's easier for people to remember the "push eax" assembly language statement than to remember the #50 machine instruction. By the way, "push eax" means: push the contents of the 32-bit EAX register located on the CPU chip, into a special place in memory called the "stack". While assembly language is easier than machine language, it is much harder than programming in Euphoria or another "high-level" language. If you make the slightest mistake you will likely crash your program or your whole system, and no one will tell you what went wrong. Euphoria lets you add machine code to your program, but you have to look up the hex codes yourself just like in the 1940's and 50's. There is no built-in assembler program inside Euphoria. On the Euphoria Archive page someone started to make an assembler for use with Euphoria, but I don't think it's well debugged yet. I have a book called "Intel Microprocessor Programmer's Reference Manual" that lists all the possible machine instructions of the 386/486/Pentium CPU's and gives me both the assembly language statement and the machine code number. In making up this String Copy example I could have used the Intel book, but actually I cheated and used my WATCOM 32-bit C compiler to generate an "assembly language plus machine code" listing of a string copy routine that I wrote in C. Most people can use Euphoria without having to know anything about machine language, but there are a few things that you can do in machine language much faster than in Euphoria. Regards, Rob Craig Rapid Deployment Software
3. Euphoria RPG
- Posted by Bryan Watts <BWatts1 at COMPUSERVE.COM> Jul 30, 1997
- 652 views
This RPG is the thing I've been waiting for! I love to code, but I'= m not that creative, so i'll be glad to help. I think I'm more than qualified.. I LOVE RPG's. They are the absolute best type of game on Earth, since they have in-depth stories (most of them), and they make you think. It's= almost as if you are the characters you play, as you get to know them ver= y well (not like in fighting games and such) I've beaten almost every RPG classic that I can find, such as Final Fantasy 1-3 (the absolute best series of RPG's), and others, such as Chrono Trigger, Secret of Mana, all= the Link-Zelda games, Illusion of Gaia, and so on. Oh yeah, even the lam= e Super Mario RPG. I also wrote my own text RPG in QBasic as an extra cred= it assignment for computers class last year. It was pretty good as far as story line and such (my teacher did give me a 105%), but, like I said, wa= s only colored text and menus. If I were to help with this game, I could come up with some killer ideas for storyline, and maybe help code some of= the math-type stuff (I can't really do graphics. I'll leave that to the others; I could code the menus and input and status and inventory and suc= h, but the AI for the monsters I may need just a little help with) Anyways, like I said, I'd love to help with this. I think it would = be pretty cool to have my name in a list of credits for a syndicated (would that be the right word?) game. Oh, and thanks to all who told me about the number input. It's funny, = I actually had downloaded the "INPUT.E" program, but when I got it, it was all bunched together on one line and totally unreadable. Oh well.. Regards, Bryan Watts