Show Posts

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 - matthias1992

Pages: 1 ... 25 26 [27] 28 29
391
ASM / Re: Coding ASM by hand
« on: July 12, 2010, 09:27:14 am »
I used tasm_on_calc which inspired me to do this but it is slow and has some bugs. Also coding in the basic editor goes slow and you easily make mistakes. If i could only figure out how to insert tokens...

392
tiDE / Re: tiDE
« on: July 11, 2010, 05:59:05 pm »
very well done! C# is a very powerful language but I prefer Visual basic personally because you don't get confused by the endless curly brackets.

I love the syntax highlighting and overall interface! loks just like Visual Studio indeed!
When do we have to expect a release?

393
ASM / Re: Coding ASM by hand
« on: July 11, 2010, 05:53:38 pm »
you input z80 asm and you get hex codes. Next step is to make a fully functional and automatic compiler. I need that tutorial on Axe really...

394
ASM / ASM base adress [start adress] in hex
« on: July 11, 2010, 09:45:19 am »
(How) can I write in hex were the program starts?
In normal asm you'd type
Code: [Select]
.org $9D95
but can you define this in hex? or does it depend on the name of the program or how full your memory is? I want to know my base adress because otherwise it is merely impossible to write JP's, JR's and CALL's in hex, and they are quite neccesary...

for example this program:
Code: [Select]
A:
    .db %11111111
B:
     call a
ret
converts to this:
Code: [Select]
FFCD9D95C9
and then to this(??(on second on-calc compilation)):
Code: [Select]
FFCD9893C9
so clearly the base adress changes once I compiled a second time...So I need to determine where in memory the prgm must reside otherwise jumps are impossible to code in hex (and they are quite complicated already because you need to count the bytes from base up to a label)

EDIT:
maybe storing PC helps? altough there is no direct way to do so. Maybe you could force PC to be pushed on the stack and then pop it into variable? however wouldn't that very action influence PC and corrupt it?
Anyone any ideas on how to do this?

395
ASM / Coding ASM by hand
« on: July 11, 2010, 07:22:45 am »
EDIT2: Seemingly my explanation is not really comprehensible because this topic has been viewed alot but 0 downloads so far...
or: is there simply no intrest in this? tell me!

One of the most difficult aspects of asm is its final output. it is just a sheer list of hexadecimal characters. There are some on calc converters that allow you to write ASM but they compile slow and are slow to write in unless you can type blindfolded on your calc. I never tried to code directly in hex but yesterday was my first try and it went suprisingly good! One problem was in looking up all the hexadecimal codes for the commands (i try to avoid bcalls altough they are pretty easy in hex).

So I wrote a program that could look up commands for me. Currently I have a 382 byte string that contains the first 20 commands of TASM80.TAB
It works as follows. It looks up the command in str0 and outputs the correct hex format. BCALL's are yet unsupported since the hex digits are swapped and well..I just ahve not included that yet. If one were to include all the commands into str0 (no bcalls, only the commands) it would take up about 6KB. However not every command is really needed/ a lot used so currently I am writing a Limited instruction set into str0 that has all the basic asm commands. If you however wanted to add a command you'd only need to typ '^' into MASM (that is what my program is called).

Well enough talk lets get down to the action:
Before you boot up make sure you have string 0 declared, if you don't use the supplied string in the attachments just store something like ":" to it.'

As you boot up MASM you get a Command Line Interface (that is a pretty glamourous description of the Input command but enver mind). You can do 4 things from here.

Q              | quits
C              | clears string0
^              | Add a command to the library
[command] | outputs the hexadecimal code for [command]

Q and C are pretty obvious but '^' isnt. Whenever you add a command you are prompted 'C:' and 'H:'.  Make sure you open up TASM80.TAB or something else, just don't make mistakes in the input...some errors are catched but a wrong hexadecimal code might eventually crash your calculator.

C: [type number here][type command here]
H: [type hex equivalent here. lenght of this must be equal to "[type number here]"]

the command is now added to the library (aka string0)
lets for example add the command EX DE,HL

Tasm80.tab says this: EX   DE,HL   EB   1 NOP 1

There are two ways to deduce the number you need to type BEFORE the command. 1 way is to multiply the number BEFORE "NOP" (or ZIX sometimes) by 2. In this case 1*2 = 2 so the number would be 2. The second method is to look at the hex-code. in this case EB = 2 characters long. I highly recommend the first method because sometimes with commands with * in it (which means something like: fill in the blanks with a hexadecimal code of a number).Now we type the command:

C:2EX DE,HL

hit [ENTER]

then the hex equivalent:

H:EB

hit [ENTER]

So now the command EX DE,HL is added to the library. We can now recall the hex code for it by typing:

EX DE,HL

which will print

EB

BCALLS use the following syntax:

EF[last two digits][first two digits]

ClrLCDFull for example = 4540h

in hex that would be:

EF4045

This program is to be a digital replacement for TI83PLUS.INC (not yet) and TASM80.tab
I consider making an app out of it eventually to avoid the use of str0. For the moment however this program must be seen as a quick and easy lookup for Z80 commands.

Feedback and critique are welcome but just remember this is a unoptimized, pre-alpha and around midnight created program which lacks optimization.

EDIT: I think AXE is just perfect for this. it allows to insert large amounts of data without using user ram and it allows me to output to an app. I think I'll have to learn axe then....

396
TI Z80 / Re: Edge
« on: July 11, 2010, 06:13:47 am »
That at the least sounds promising. Makes me curious about all the tricks you used to get it so small and fast.

397
Have you read the tutorials from the beginning?  I'd recommend you do so if you haven't:  It's my goal that the lessons are easy to understand, and thus I can't really explain the difference, you should read about it.

However, I will say that HL is a number, such as a ram location.  (HL) is whatever is stored in RAM at that location.  (HL) can be used almost any place where you can use "One-Byte Register" as a parameter.  If this confuses you, I highly recommend you read from the beginning :)
I understand the difference between HL and (HL) (i did not read your tutorials from the beginning but i did read Sean Mclaughin's ams in 28 days) my question is what you mean with it. Or better said: what does HL have to do with the commands SRL and SLA? why is it involved. SRA and SLA are on-byte register commands so what does HL have to do with it?
Is (HL) (adress location) modified because you use these commands? or does it destroy HL?

398
I just came up with another question, sorry for bothering but in the SRL and SLA functions you say "Register is (HL)" I am slightly confused about that. One thing is what does HL to do with these and the second is do you mean HL or (HL)?
Once again my apologies for annoying you, its my pleasure...  ;D

399
No, it is simultaneous, the operations are internal to the CPU and are performed at the same time.
I can't imagine that...The only truly parallel devices I have ever programmed are FPGA's because every block is dedicated to a specific task. But indeed hot_dog, it is irrelevant. I just remembered that it simply rotates so what happens first indeed does not matter.

thanks for the fast replies.
 

400
Thats a relief :P

On the RL instruction you say it moves the carry into bit 0 and bit 7 into the carry. But what happens first? it can never happen at the same time since CPU's are sequentially processing data so is it in the order you mention or the converse?

EDIT: I think it should be 7 into carry and then carry into bit 0 because it is a rotation...

Once again, just saying...

401
Cool:
You already said in your 48 lines program that it could be optimized, would this be valid? I understand this uses DJNZ which I can not recall you mentioned in one of the earlier lessons (not that I have read them all) so this is no offense or something I just wonder IF this is valid code and if it is, would it be faster?
Code: [Select]

LD HL, PlotSScreen
LD A, %10101010
LD B, 120
Loop:
LD (hl), A
INc HL
DJNZ Loop
B_Call(_GrBufCpy)
B_Call(_getKey)
B_Call(_ClrLCDFull)
;I never display done...don't like it :P

402
S.A.D. (Seek and Destroy) / Re: S.A.D. The Xaos Race
« on: July 07, 2010, 01:18:43 pm »
Ty both. Bigfoot really is my favourite unit personally...

403
Miscellaneous / Re: Silly things you did as a noob
« on: July 06, 2010, 09:05:42 am »
I used to write tremendous amounts of IF's for nealry everything. I know boolanize (if that is a word) as much as I can. ooh and you now what is cool to do in spare time? coding in eso...something languages like: whitespace, Aargh!, BrainF** and l33t.
if you ever thought assembly was hard...

404
S.A.D. (Seek and Destroy) / Re: S.A.D. The Xaos Race
« on: July 05, 2010, 03:14:13 pm »
I live next to a forest so no worries...

Ehr yes I would like to make that campaign but I'll need lots of help! Let's say we'll do it together ok? but you can shove the work towards me...

405
S.A.D. (Seek and Destroy) / Re: S.A.D. The Xaos Race
« on: July 05, 2010, 12:09:56 pm »
Thank you
I know. I guess the chunker is different as is the xelectron...(makes curiosity arise...)

Pages: 1 ... 25 26 [27] 28 29