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 z80 & ez80 Assembly 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. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 30 Dec 2009 05:41:30 pm    Post subject:

I have been using TASM (Telemark Assembler) to compile my z80 programs for quite some time. However, I noticed that TASM does not have .dd/.dword or .dq/.qword directives for the insertion of large numbers (ie, greater than $FFFF) as data into programs. Does anyone know of an assembler that does?? Thanks.
Back to top
FloppusMaximus


Advanced Member


Joined: 22 Aug 2008
Posts: 472

Posted: 30 Dec 2009 09:00:04 pm    Post subject:

I think zmasm has a dl directive; miniasm does, and I know I've seen other assemblers that have something equivalent. But most assemblers use 32-bit math anyway, so you can define dl (or dd, or whatever you want to call it) as a macro. I don't know of any Z80 assembler that uses 64-bit math, though.
Back to top
magicdanw
pcGuru()


Calc Guru


Joined: 14 Feb 2007
Posts: 1110

Posted: 30 Dec 2009 09:07:06 pm    Post subject:

I used gcc for a class last semester, and it was great. However, I don't know if it can target z80. I guess it probably can't, cause if it could, people would be using it already.
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 31 Dec 2009 05:02:33 am    Post subject:

FougereRapide wrote:
I have been using TASM (Telemark Assembler) to compile my z80 programs for quite some time. However, I noticed that TASM does not have .dd/.dword or .dq/.qword directives for the insertion of large numbers (ie, greater than $FFFF) as data into programs. Does anyone know of an assembler that does?? Thanks.

You could macro in .dd/.dword and .dq/.qword in TASM or SPASM (other assembler) or change the source code of SPASM.


Code:
;SPASM macros (not tested)
#macro qwordm(value)
 .dw value/256/256
 .dw value & $0000FFFF
#endmacro
;this make SPASM accept things like: " .dq 2143541", just like a directive
#define .dd qwordm(
#define .dword qwordm(

;TASM (not tested and I don't do macros for TASM...)
#define qword(value)  .dw value/256/256 \ .dw value & $0000FFFF
;usage: qword(92746616)
Back to top
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 31 Dec 2009 10:51:02 am    Post subject:

i may be wrong, but, to make it so that the LSB is first, shouldn't you reverse the order of the macro?, ie:

Code:
    .dw value & $0000FFFF
    .dw value/65536
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 31 Dec 2009 03:36:56 pm    Post subject:

FougereRapide wrote:
i may be wrong, but, to make it so that the LSB is first, shouldn't you reverse the order of the macro?, ie:

Code:
    .dw value & $0000FFFF
    .dw value/65536

z80 is little endian, I have to think to know how it should be... But you got the idea of how the macro should be.
Back to top
fougere


Advanced Newbie


Joined: 07 Aug 2009
Posts: 56

Posted: 31 Dec 2009 03:50:57 pm    Post subject:

Thanks. It works perfectly! Actually, I don't think the "& $0000FFFF" is really necessary because the .dw automatically takes just the lower word.
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