This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - Quigibo
Pages: 1 ... 120 121 [122] 123 124 ... 135
1816
« on: March 16, 2010, 09:58:29 pm »
That's a cleaver trick! But wouldn't something like this be simpler?
or a sbc hl,de add hl,de jr nc,$+3 ex de,hl
But I'm trying to convert all of my math commands to signed operations anyway, so I would need to tweak it a bit.
I'm going to try your multiplication routine again and see if its smaller. I think I forgot the ret at the end which might of been what screwed me up.
1817
« on: March 16, 2010, 06:37:02 pm »
More generally, here is what int(x) does:
if 0<x<127, then int(x)=x if 128<x<255, then int(x)=x-256
(those should be "less than or equal to" signs) So it turns 255 into -1, 254 into -2, 253 into -3... but keeps positive bytes the same.
1818
« on: March 16, 2010, 02:35:57 pm »
'CHAR' is new. So is EHEX.
1819
« on: March 16, 2010, 12:44:59 pm »
I'm thinking maybe Ξ”List() right now unless I find something better.
1820
« on: March 16, 2010, 12:38:03 pm »
Sorry about the doc. You're right, I didn't have time. I added the documentation the last minute because I was on my laptop in the library and I realized my battery was running low so I scrambled to put it together as fast as I could. Still don't have internet yet, probably won't for a while, but I don't mind since I'm trying not to be too distracted from my school work and I'm at school almost every day anyway so I just use it there. I'll try to make it more clear in the next version.
Also you mentioned that you didn't see the hex and ascii constants? Those are just alternative ways to write numbers. Its in the middle of the doc somewhere.
Instead of 11->A it is sometimes more convenient to write E000B->A as hexadecimal, especially when you want to access certain locations in the RAM since they are defined in hex, not base 10. Its a pretty low lew command though, you generally won't need it, but it was requested so I figured I might as well since at the same time I was doing ASCII constants.
You might be familiar with ASCII already, but each character is represented by a number. So if you need to display a single character, than instead of Disp "A" you can do Disp 'A'>Frac which saves some bytes. But you'll most often use this when reading from a string and comparing the characters to another character. Also, this makes it easy to store data using strings instead of hex since they are easier to read. Entire maps can be made with a string since you can make statements now like If {Str1+X}='A'
1821
« on: March 16, 2010, 11:19:13 am »
I cannot use the BASIC format for list handling. L1(X) is ambiguous in BASIC since you can't tell if you are multiplying by X or finding the Xth element. This always bugged me. Similarly, in Axe, it can't tell if you are starting a new expression or finding the element of a list.
Don't forget, axe interprets a command written like this:
:Disp {A*2+L1}
As this:
:A :*2 :+L1 :{} :Disp
Both of these compile exactly the same way byte for byte in the executable. So you can see why the parenthesis notation would be too ambiguous.
But YES, I am definitely going to add a byte data structure so you can define values in base 10 integers instead of just hex and strings. It will be the same syntax as BASIC lists, but I think I will need to use something other than the curly brackets.
1822
« on: March 15, 2010, 11:57:39 pm »
@Omnimaga
You don't have to use the new commands. They are just optimizations to what you could have already done with the old ones, but now in less code and faster speed. Did you see the routine builderboy made for multiplying negative numbers? If you look at that code, it is almost unreadable and bizarre looking to someone who doesn't know unsigned arithmetic. Now, if I had made a separate command to do that for you (even if the logic behind the command is hard to understand) it makes the code much easier to read and to program. Try making your own routines to do the same functions and you will see how convenient these new shortcuts are.
1823
« on: March 15, 2010, 11:48:02 pm »
I meant -1 times -1 sorry. I just copied and pasted it btw.
1824
« on: March 15, 2010, 11:46:17 pm »
The only real low level command is the int() which is the sign extension command. You would mostly use this command when you need to store negative numbers into the RAM in an array. Negative numbers need 2 bytes since they behave like large positive numbers. But since you can only store one byte then when you go to read it it will turn into a really small number. Try doing this:
-1->{L1} Disp {L1}>Dec
This will not display the 65535 that it is supposed to, instead it will be a smaller positive number. The way around this is sign extension. So if you do this instead:
Disp int({L1})>Dec
It will return the correct value. This only works when the stored value is between -128 and 127.
1825
« on: March 15, 2010, 11:30:34 pm »
Hope everyone likes the new update. Should make a few things a little easier. I haven't converted to signed numbers yet since I still have a lot more routines to change. I haven't even tested some of the new commands yet other than trivial examples because I've been busy, but I think they all work.
1826
« on: March 15, 2010, 11:25:58 pm »
Axe Parser Alpha 0.1.2 New Features:- Automated data copy, exchange, and fill.
- Absolute value for signed numbers
- Sign extension for single byte signed numbers
- Hexadecimal constants
- ASCII constants
Changed:- Multiplication should work with signed numbers now.
- Comments now need to start with a period instead of a single quote.
No new examples since I didn't have time to make anything.
1827
« on: March 15, 2010, 11:20:27 pm »
Uh oh. That's my error trapper. It automatically quits when the stack was not left where it was supposed to be, that means I have a leak. I will look into it, but it would help if you could provide the source that gave the error. Send me a PM or email if you don't want to show the source publicly (if its part of a secret project or something).
1828
« on: March 15, 2010, 11:15:32 pm »
Builderboy, you're thinking of a 1's compliment system where the last bit is just a sign bit. 2's compliment is a little bit different. The advantage of 2's compliment system is that it is arithmetically (and apparently also multiplicitively) compatible with unsigned numbers.
By the way calcmaniac, your code didn't work. I tried -1 times 1 and it returned a weird number. But I was able to create my own routine after looking at some other code. Its a little slower, but its roughly the same size as the original 8bit routine.
1829
« on: March 15, 2010, 08:57:53 pm »
I've got no clue whether or not you've seen this, but I think it might be of some help. http://map.grauw.nl/sources/external/z80bits.html
Yeah, that's what I've been using, but it doesn't have many signed routines, just unsigned.
1830
« on: March 15, 2010, 01:44:10 pm »
Kind of. I'm going to release all of my templated assembly code that the executable programs use, but I don't think I will release the source of the parser itself. Right now, I'm not too worried about the optimizations. Its the actual code of the Parser I am trying to finished first so I can release a beta, but I keep getting distracted by wantting to add more commands since they're relatively easier and more fun
Pages: 1 ... 120 121 [122] 123 124 ... 135
|