CEMETECH
Leading The Way To The Future
   
Login [Register]
Username:
Password:
Autologin:
Latest Headlines
Online Users
There are a total of 56 users online: 13 members, 22 guests and 21 bots.
Members: benryves, builderboy2005, calc84maniac, comicIDIOT, Hyped, KeithJohansen, KermMartian, LordConiupiter, souvik1997, TC01, TheStorm, WhiteValkery, _player1537.
Bots: Ask Jeeves (6), Googlebot (2), Yahoo! Slurp (2), EntireWeb (1), Baidu (5), Spinn3r (4), MSN/Bing (1).
RSS Feeds
[RSS] News Headlines
[RSS] Latest Posts
SAX
You must log in to view the SAX chat widget
Cemetech Forum Index -> Your Projects
 
Post new topic   Reply to topic » Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
» View previous topic :: View next topic  
Author Message
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 08 Sep 2006 04:22:00 pm    Post subject: OTBP Assembler 1 Reply with quote

I am thinking about making an compiler on-calc similar to TASM oncalc. I just made an asm program that will copy program data into a string (even if it's archived Wink ), and I'm wondering if anyone has any good compiling techniques I could use.

BTW, I'm going to try to accomplish relative addressing.

Update: Now at v1, here's the link
Features so far:
    File types:
  • Source files
  • Include files
  • Includable headers
  • Supports archived files
    Immediate values:
  • Decimal
  • Binary
  • Hexadecimal
  • Equates
  • ASCII
    Assembling:
  • ix/iy can be used wherever hl can
  • (ix/iy +/- value) can be used wherever (hl) can
  • Supports jr/djnz
  • Many commands are included in the main program to save space
  • Memory-saving techniques are used while compiling
  • Skips empty lines
  • Supports Ion/MirageOS/DCS6
  • Comments
  • No case sensitivity
  • Brackets no longer needed
  • Error catching
    Coming Soon...
  • Ideas, please?
I will add more to the list when I have time.
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)


Last edited by calc84maniac on 06 Jan 2007 10:10:38 am; edited 12 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 7153

PostPosted: 08 Sep 2006 04:23:55 pm    Post subject: Reply with quote

What sort of compiler? A Z80 compiler? Some new language? Why store it to a string?
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 08 Sep 2006 04:26:39 pm    Post subject: Reply with quote

A Z80 compiler (after all, this is the Z80 asm forum).
The main compiler will be in BASIC, so it will copy the source and include files to strings to manipulate them easier.
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 7153

PostPosted: 08 Sep 2006 04:27:36 pm    Post subject: Reply with quote

You are trying to make a Z80 compiler in BASIC? I'd reconsider that in a hurry, and make the compiler in ASM, too
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
b-flat


Advanced Member


Joined: 01 Sep 2006
Posts: 225

PostPosted: 08 Sep 2006 04:29:11 pm    Post subject: Reply with quote

So, you decided to learn ASM?

Sounds good, except the part about it being mainly in basic, but I didn't learn enough ASM to be of much use to you here...

Not sure how you'll do it.

Good luck creating it and I hope you can complete it.

Wow, there are 15 users online: 8 members, 2 guests and 5 bots!!! Earlier, there were still 15 users, but only 3 bots (4 guests).


Last edited by b-flat on 08 Sep 2006 04:29:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 08 Sep 2006 04:29:53 pm    Post subject: Reply with quote

The TASM oncalc guy accomplished it in BASIC, and I'm trying to make a better version.

Edit: Please notice my request for good techniques, it seems that everyone's missed that.
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Harq


Calculator Deity


Joined: 15 May 2006
Posts: 1857
Location: Elsewhere

PostPosted: 08 Sep 2006 05:15:36 pm    Post subject: Reply with quote

calc84maniac wrote:
The TASM oncalc guy accomplished it in BASIC, and I'm trying to make a better version.

Edit: Please notice my request for good techniques, it seems that everyone's missed that.


You will note that he also uses an ASM program (atleast from what I can remember...).

Just wondering, is ASMEXEC( to run asm? ( something like ASMEXEC(A75385FE6C) and no, this is not real ASM hex (asfar as I know Rolling Eyes )
_________________
Any fool can use a computer. Many do.





Back to top
View user's profile Send private message
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 08 Sep 2006 05:20:59 pm    Post subject: Reply with quote

Harq wrote:
Just wondering, is ASMEXEC( to run asm? ( something like ASMEXEC(A75385FE6C) and no, this is not real ASM hex (asfar as I know )

With Omnicalc, yes.

My version will be much more memory-efficient because it will support archived source/include files.

Does anyone at least know of a site which can give me techniques? When I Google it, it just gives me compilers that other people have made.
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 31776
Location: Earth, Sol, Milky Way

PostPosted: 08 Sep 2006 06:20:05 pm    Post subject: Reply with quote

The biggest challenge with oncalc ASM is text labels and the equates table, for example _clrgrbuf = NNNNh. With a lot of labels, the compilation tables far exceed the amount of RAM even an empty z80 has.
_________________


Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 7153

PostPosted: 08 Sep 2006 10:22:13 pm    Post subject: Reply with quote

You *could* potentially get around that by making several tables, and using the first letter or two as a table index.... I think that would work, although it would still take up alot of archive space
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 09 Sep 2006 03:41:44 pm    Post subject: Reply with quote

Success! The only things mine doesn't support now are:
  • set/res/bit
  • binary
And maybe a couple others that I forgot.
Program size: 2077
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Harq


Calculator Deity


Joined: 15 May 2006
Posts: 1857
Location: Elsewhere

PostPosted: 09 Sep 2006 04:02:55 pm    Post subject: Reply with quote

calc84maniac wrote:
Success! The only things mine doesn't support now are:
  • set/res/bit
  • binary
And maybe a couple others that I forgot.
Program size: 2077


That was fast Surprised
_________________
Any fool can use a computer. Many do.





Back to top
View user's profile Send private message
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 09 Sep 2006 04:04:51 pm    Post subject: Reply with quote

I'll attach the files if someone tells me how (so you can beta test it).
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 09 Sep 2006 05:00:03 pm    Post subject: Reply with quote

Never mind, I figured it out on my own.
Here's the link.
I assume no responsibility for any RAM resets.
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Harq


Calculator Deity


Joined: 15 May 2006
Posts: 1857
Location: Elsewhere

PostPosted: 09 Sep 2006 05:07:26 pm    Post subject: Reply with quote

calc84maniac wrote:
Never mind, I figured it out on my own.
Here's the link.
I assume no responsibility for any RAM resets.


Use edit from now on please
_________________
Any fool can use a computer. Many do.





Back to top
View user's profile Send private message
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 09 Sep 2006 05:11:06 pm    Post subject: Reply with quote

Okay. BTW, here are the built-in commands: (no include file needed for these)
ld 8-bit-reg,
add a,
adc a,
sub
sbc
and
xor
or
cp
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Harq


Calculator Deity


Joined: 15 May 2006
Posts: 1857
Location: Elsewhere

PostPosted: 09 Sep 2006 05:12:42 pm    Post subject: Reply with quote

Could you post the source code?
_________________
Any fool can use a computer. Many do.





Back to top
View user's profile Send private message
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 09 Sep 2006 05:40:13 pm    Post subject: Reply with quote

BASIC Code wrote:
:ClrHome
:Disp "COMPILER v0.5
:Input "prgm",Str0
:Str0
:DelVar Str0Asm(prgmZCOMPILE
:Str0
:DelVar Str0Ans→Str1
:sub(Ans,inString(Ans,"prgm")-1,1→Str8
:Ans→Str9
:Str1+Ans→Str1
:Repeat "prgm"=sub(Str1,1,1
:sub(Str1,1,inString(Str1,Str8)-1
:Asm(prgmZCOMPILE
:Str0
:DelVar Str0Str9+Ans+Str8→Str9
:inString(Str1,Str8
:sub(Str1,Ans+1,length(Str1)-Ans→Str1
:End
:inString(Str1,Str8
:sub(Str1,Ans,length(Str1)-Ans+1→Str1
:"ZCOMPIL2
:Asm(prgmZCOMPILE
:inString(Str1,"(hl)
:While Ans
:sub(Str1,1,Ans-1)+"g"+sub(Str1,Ans+4,length(Str1)-Ans-3→Str1
:inString(Str1,"(hl)
:End
:"AsmPrgm"+Str8→Str7
:40341→M
:"ld b,ld c,ld d,ld e,ld h,ld l,ld g,ld a,add a,adc a,sub sbc and xor or cp →Str3
:cumSum(1,5,5,5,5,5,5,5,5,6,6,4,4,4,4,3,3→L3
:Disp "PART 1:0
:1→B
:Repeat B=length(Str1
:B+1→A
:inString(Str1,Str8,A→B
:sub(Str1,A,B-A→Str2
:Output(8,1,Ans+"
:length(Str2
:If sub(Str2,Ans,1)=":
:Then
:Str9+sub(Str2,1,Ans-1→Str9
:int(M/256
:Str9+expr(Str0→Str9
:256fPart(M/256
:Str9+expr(Str0)+Str8→Str9
:Else
:If inString(Str2,".db
:Then
:5→C
:inString(Str2,",→D
:If not(Ans
:1+length(Str2→D
:Repeat C>length(Str2
:sub(Str2,C,D-C→Str4
:If "h"=sub(Ans,length(Ans),1
:Then
:If 2=length(Ans
:"0"+Ans→Str4
:Str7+sub(Str4,1,2→Str7
:M+1→M
:Else
:If inString("0123456789",sub(Str4,1,1
:Then
:expr(Str4
:Str7+expr(Str0→Str7
:M+1→M
:Else
:expr(Str4→Str4
:M+length(Ans→M
:For(F,1,length(Str4
:Output(7,1,sub(Str4,F,1
:0
:Asm(prgmZCOMPILE
:Str7+expr(Str0→Str7
:End
:End
:End
:D+1→C
:inString(Str2,",",C→D
:If not(Ans
:1+length(Str2→D
:End
:Output(7,1,"
:Else
:If inString(Str2," ([
:Then
:If inString(Str2,"out
:Then
:Str7+"D3??→Str7
:M+2→M
:Else
:If inString(Str2,"]),a
:Then
:Str7+"32????→Str7
:Else
:Str7+"22????→Str7
:End
:M+3→M
:End
:Else
:inString(Str2,"[
:If Ans
:sub(Str2,1,Ans→Str2
:0→C
:Repeat C=16 or Ans
:C+1→C
:inString(Str2,sub(Str3,L3(C),L3(C+1)-L3(C
:End
:If Ans and not(inString(Str2,"(
:Then
:If inString(Str2,"[
:Then
:8C-2+128(C>8
:Str7+expr(Str0)+"??→Str7
:M+2→M
:Else
:55+8C+inString("bcdehlga",sub(Str2,L3(C+1)-L3(C)+1,1
:Str7+expr(Str0→Str7
:M+1→M
:End
:Else
:inString(Str9,Str2→C
:If Ans
:Then
:expr(sub(Str9,C-1,1→D
:C+length(Str2→E
:inString(Str9,Str8,C
:If Ans≠E
:Then
:sub(Str9,E,Ans-E→Str4
:Str7+Ans→Str7
:Else
:"→Str4
:End
:2D-length(Str4
:If Ans
:Str7+sub("????",1,Ans→Str7
:M+D→M
:End
:End
:End
:End
:End
:Output(3,8,int(BE2/length(Str1
:End
:Disp "PART 2:
:Str7+Str8→Str7
:0→B
:While inString(Str7,"?
:inString(Str7,"?→A
:Output(4,8,int(AE2/length(Str7
:sub(Str7,Ans+2,1)="?→F
:inString(Str1,"[",B+1→B
:inString(Str1,"]",B
:sub(Str1,B+1,Ans-B-1→Str2
:Output(8,1,Ans+"
:inString(Str9,Str8+Ans→C
:If C and not(inString("0123456789",sub(Str2,1,1
:Then
:inString(Str9,Str8,C+1→D
:C+1+length(Str2
:sub(Str9,Ans,D-Ans)+"h→Str2
:End
:B-6
:If Ans≤0
:1
:inString(Str1,"jr",Ans),inString(Str1,"djnz",Ans
:If max(Ans and Ans<B
:Then
:sum(seq(16^(4-X)(inString("0123456789ABCDEF",sub(Str2,X,1))-1),X,1,4))-40341-.5(A-1
:If Ans<0
:Ans+256
:sub(Str7,1,A-1)+expr(Str0)+sub(Str7,A+2,length(Str7)-A-1→Str7
:Else
:If inString(Str2,"h
:Then
:While 5≠length(Str2
:"0"+Str2→Str2
:End
:sub(Str7,1,A-1)+sub(Str2,3,2
:If F
:Ans+sub(Str2,1,2
:Ans+sub(Str7,A+2+2F,length(Str7)-A-2F-1→Str7
:Else
:expr(Str2→D
:256fPart(D/256
:expr(Str0→Str2
:If F
:Then
:int(D/256
:Str2+expr(Str0→Str2
:End
:sub(Str7,1,A-1)+Str2+sub(Str7,A+length(Str2),length(Str7)-A+1-length(Str2→Str7
:End
:End
:End
:Output(4,8,E2
:DelVar Str1DelVar Str2DelVar Str3DelVar Str8DelVar Str9DelVar L1DelVar L2DelVar L3sub(Str7,1,length(Str7)-1→Str7
Generated by SourceCoder, © 2005 Cemetech

_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Harq


Calculator Deity


Joined: 15 May 2006
Posts: 1857
Location: Elsewhere

PostPosted: 09 Sep 2006 06:01:17 pm    Post subject: Reply with quote

What is zcompile?
_________________
Any fool can use a computer. Many do.





Back to top
View user's profile Send private message
calc84maniac


Epic z80 roflpwner

Joined: 01 Aug 2006
Posts: 1296
Location: The ex-planet Pluto

PostPosted: 09 Sep 2006 06:03:44 pm    Post subject: Reply with quote

It's the asm subroutine.
Inputs:
String: Copies program whose name is in string into Str0.
Otherwise: Returns the ASCII code for whatever is at row 7, col 1. (For use with .db)
_________________
~calc84maniac has spoken.

Projects:
F-Zero
Super Mario (aka Project M)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic » Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
» View previous topic :: View next topic  
Page 1 of 9 » All times are GMT - 5 Hours

 
Jump to:  
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 vote in polls in this forum

Forum powered by phpBB

© Copyright 2000-2010 Cemetech & Kerm Martian :: Page Execution Time: 0.090835 seconds.