This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Your Projects subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Project Ideas/Start New Projects => Your Projects
Author Message
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 18 Jul 2008 11:05:56 pm    Post subject:

Attached is a program I made to allow code written on the calc to also be converted to a z80 file and vice versa. This allows flexibility between the ease of programing on the computer and the portability of programming on the calculator.
Once again, please provide feedback and report if you find any bugs.
Back to top
magicdanw
pcGuru()


Calc Guru


Joined: 14 Feb 2007
Posts: 1110

Posted: 18 Jul 2008 11:49:04 pm    Post subject:

This is interesting, but I'm not sure I understand exactly what it does. Does it convert the assembler source to a basic program, so you can edit it on the calculator?
Back to top
WikiGuru
ADOS (Attention deficit... Oh! Shiny!)


Elite


Joined: 15 Sep 2005
Posts: 923

Posted: 19 Jul 2008 12:18:05 pm    Post subject:

I think he wrote a disassembler.
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 19 Jul 2008 12:50:13 pm    Post subject:

magicdanw wrote:
This is interesting, but I'm not sure I understand exactly what it does.  Does it convert the assembler source to a basic program, so you can edit it on the calculator?
[post="125403"]<{POST_SNAPBACK}>[/post]


uh... yes. If you create a basic program on the calculator for use as source for Phasm, you can use this program to convert it to a z80 file. It also goes the other way. It will convert z80 source to source on the calculator.
Back to top
Flameviper


Advanced Newbie


Joined: 05 Jun 2008
Posts: 62

Posted: 19 Jul 2008 04:37:34 pm    Post subject:

So what exactly is the advantage of converting a BASIC file to Z80? Does it speed up the program or decrease file size?
Back to top
Cryzbl


Newbie


Joined: 20 Jun 2008
Posts: 46

Posted: 19 Jul 2008 05:00:19 pm    Post subject:

No silly, this program disassembles asm programs so they can be edited and recompiled with his on-calc assembler Phasm Wink
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 19 Jul 2008 05:02:45 pm    Post subject:

Flameviper wrote:
So what exactly is the advantage of converting a BASIC file to Z80? Does it speed up the program or decrease file size?
[post="125406"]<{POST_SNAPBACK}>[/post]



Cryzbl wrote:
No silly, this program disassembles asm programs so they can be edited and recompiled with his on-calc assembler Phasm Wink
[post="125407"]<{POST_SNAPBACK}>[/post]


You are both wrong but Cryzbl is closer. This program only deals with assembly sources. It converts between the source for a computer assembler (like Tasm, Brass, Spacm) and my on-calc assembler, Phasm.
Back to top
WikiGuru
ADOS (Attention deficit... Oh! Shiny!)


Elite


Joined: 15 Sep 2005
Posts: 923

Posted: 19 Jul 2008 05:09:55 pm    Post subject:

Oh! So it's the exact opposite of the AsmComp( function!

@Flameviper: It's possible to create asm programs on the calculator by entering the hex using numbers and the letters A-F into a basic program with the first line being the AsmPrgm token. However, to run it it needs to converted into runable opcodes, as opposed to the ASCII values of the numbers/letters for the hex.

Example:
AsmPrgm
C9

Type this into your a new basic program. You wouldn't be able to run it as is, though because if you try instead of doing nothing, it could very well crash your calculator because although "C9" is the opcode for ret, that's not what your calculator is running. It's really running the opcodes 43 39, which I have absolutely no idea what it does. By using AsmComp(, it will make this change for you. What c_plus_plus did was provide the reverse, which TI left out.

Correct me if I'm wrong, c_plus_plus.


Last edited by Guest on 30 Jul 2010 05:19:54 am; edited 1 time in total
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 19 Jul 2008 05:22:15 pm    Post subject:

WikiGuru wrote:
Correct me if I'm wrong, c_plus_plus.
[post="125409"]<{POST_SNAPBACK}>[/post]

will do. Why is this so difficult to understand? Ill try to explain more clearly.

Say you type this code into your calculator for use with Phasm:

Code:
:.ORG 9D95H
:.DB 6DBBH
:LD HL, (MSG)
:BprgmCALL(450AH) E PUTS
:RET
:MSG:
:.DB "HELLO", 0


Now, you wanted to continue the project you started on the calculator on the computer, so you upload your file as Hello.8xp. now you run the computer program posted here called 8xp2z80.exe as follows:

Code:
8xp2z80.exe Hello.8xp Hello.z80

Now, if you were to open Hello.z80 on your computer it will appear as follows:

Code:
#include "phasm.inc"
 .db 6dbbh
 ld hl, (msg)
 b_call(450ah); puts
 ret
msg:
 .db "hello", 0


Does this clear it up?

Edit: punctuation.


Last edited by Guest on 19 Jul 2008 05:25:50 pm; edited 1 time in total
Back to top
Liazon
title goes here


Bandwidth Hog


Joined: 01 Nov 2005
Posts: 2007

Posted: 19 Jul 2008 05:37:39 pm    Post subject:

so basically, you convert between the .z80/.asm file (which is nothing more than a .txt) and the basic program file format (no clue what extension that is) so you can transfer your PHASM source from your calc to your computer to be used w/ TASM/SPASM/BRASS?
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 19 Jul 2008 05:42:02 pm    Post subject:

Liazon wrote:
so basically, you convert between the .z80/.asm file (which is nothing more than a .txt) and the basic program file format (no clue what extension that is) so you can transfer your PHASM source from your calc to your computer to be used w/ TASM/SPASM/BRASS?
[post="125411"]<{POST_SNAPBACK}>[/post]


Yes!! Btw, the extension for the program file is *.8xp (thus the name of the converter program.) Also, you just brought up something interesting: should I also allow the *.asm extension? Currently this program forces you to use *.z80.
Back to top
black-salamander


Newbie


Joined: 07 Apr 2008
Posts: 49

Posted: 19 Jul 2008 09:55:00 pm    Post subject:

Quote:
should I also allow the *.asm extension? Currently this program forces you to use *.z80.

Couldn't you just change the extension to *.asm? But then again, personally I am too lazy to do stuff such as changing the file extension anyways Cool
Just to clear things up: So your program is essentially a *.8xp to *.z80 converter, in which *.z80 can be viewed just like a *.txt file, so ultimately your program can open and edit normal *.8xp files. Or does your Phasm sources have to have a certain header to indicate it can be only opened by your program to be edited by your favorite editor?
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 19 Jul 2008 10:05:25 pm    Post subject:

[quote name='black-salamander' date='Jul 19 2008, 08:55 PM']Couldn't you just change the extension to *.asm? But then again, personally I am too lazy to do stuff such as changing the file extension anyways Cool
[post="125415"]<{POST_SNAPBACK}>[/post][/quote]
So... is that a yes?

[quote name='black-salamander' date='Jul 19 2008, 08:55 PM']Just to clear things up: So your program is essentially a *.8xp to *.z80 converter, in which *.z80 can be viewed just like a *.txt file,
[post="125415"]<{POST_SNAPBACK}>[/post][/quote]
yes.

[quote name='black-salamander' date='Jul 19 2008, 08:55 PM']so ultimately your program can open and edit normal *.8xp files. Or does your Phasm sources have to have a certain header to indicate it can be only opened by your program to be edited by your favorite editor?
[post="125415"]<{POST_SNAPBACK}>[/post][/quote]
The sources don't have special headers, but the source files won't run as Basic files, and Basic files won't turn out right when run through this program.
Back to top
Taricorp


Member


Joined: 09 Mar 2006
Posts: 188

Posted: 19 Jul 2008 10:07:21 pm    Post subject:

Just default to .z80, but follow the extension the user supplies if they supply one.
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 19 Jul 2008 10:10:24 pm    Post subject:

Taricorp wrote:
Just default to .z80, but follow the extension the user supplies if they supply one.
[post="125417"]<{POST_SNAPBACK}>[/post]

This won't quite work. The way the program can tell if the user is converting from .8xp or from .z80 is exclusively with the extension. While I could add the .asm extension and treat it the same as a .z80 extension, I cannot "follow the extension the user supplies."

Edit: I appreciate the feedback (even though half of it is confusion about what this program does.) I would like to request that any Phasm users likewise provide feedback in the Phasm thread (link in signature.)


Last edited by Guest on 19 Jul 2008 10:13:08 pm; edited 1 time in total
Back to top
kermmartian
Site Admin Kemetech


Calc Guru


Joined: 20 Mar 2004
Posts: 1220

Posted: 20 Jul 2008 09:58:33 am    Post subject:

c_plus_plus wrote:

Code:
#include "phasm.inc"
 .db 6dbbh
 ld hl, (msg)
 b_call(450ah); puts
 ret
msg:
 .db "hello", 0


[post="125410"]<{POST_SNAPBACK}>[/post]


This code is wrong; it should be .dw 6dbbh or .db 0bbh,6dh
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 20 Jul 2008 10:52:25 am    Post subject:

kermmartian wrote:
c_plus_plus wrote:


Code:
#include "phasm.inc"
 .db 6dbbh
 ld hl, (msg)
 b_call(450ah); puts
 ret
msg:
 .db "hello", 0


[post="125410"]<{POST_SNAPBACK}>[/post]


This code is wrong; it should be .dw 6dbbh or .db 0bbh,6dh
[post="125422"]<{POST_SNAPBACK}>[/post]

However, it is a faithful conversion of the original 8xp version. So in that regard it fulfills its purpose.
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 20 Jul 2008 08:01:58 pm    Post subject:

sgm wrote:
kermmartian wrote:
c_plus_plus wrote:


Code:
#include "phasm.inc"
 .db 6dbbh
 ld hl, (msg)
 b_call(450ah); puts
 ret
msg:
 .db "hello", 0


[post="125410"]<{POST_SNAPBACK}>[/post]


This code is wrong; it should be .dw 6dbbh or .db 0bbh,6dh
[post="125422"]<{POST_SNAPBACK}>[/post]

However, it is a faithful conversion of the original 8xp version. So in that regard it fulfills its purpose.
[post="125424"]<{POST_SNAPBACK}>[/post]

The funny thing is sometime after typing this I made the same mistake in some code I actually wanted to assemble. Needless to say, the assembler gave an error.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement