Author Topic: Standalone Z80 Assembler in Java  (Read 8333 times)

0 Members and 1 Guest are viewing this topic.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.039
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1007
Standalone Z80 Assembler in Java
« on: 14:36, 15 June 10 »
Hi!
Together I decided to release a standalone Z80 Assembler written in Java.
(It's almost similar to the one I use in JavaCPC)
Important commands:
write"MYFILE.BIN"   Stores your assembled code as binary (With AMSDOS header)
noheader                   Disable AMSDOS header (Output binaries are stored as RAW)
list / nolist                 Shows / hides info log output

This assembler is not 100% maxam compatible!
Functions like IF/ENDIF or INCLUDE"myfile.asm" don't work!

It knows all documented Z80 instructions.
Some undocumented are included, too.

It's not perfect but maybe useful to compile quick things without using an emulator / a CPC.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Liked: 758
Re: Standalone Z80 Assembler in Java
« Reply #1 on: 13:33, 17 June 10 »
Unless I missed something, what's the point in a Z80 assembler when there are already excellent and fully-featured assembler like SJAsmPlus ?

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.331
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2241
Re: Standalone Z80 Assembler in Java
« Reply #2 on: 13:48, 17 June 10 »
Unless I missed something, what's the point in a Z80 assembler when there are already excellent and fully-featured assembler like SJAsmPlus ?
Markus implemented a z80 assembler within javacpc.

Here he has just repackaged it for standlone use if wanted.

My personal assembler choice is pasmo or z80asm (comes with z88dk) for true relocatable code.
Others choose winape, and your choice is sjasmplus.

So feel free not to use this one ;)

EDIT: In the end, the result of using the tools is what most people see and find important.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.039
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1007
Re: Standalone Z80 Assembler in Java
« Reply #3 on: 13:56, 17 June 10 »
Unless   I missed something, what's the point in a Z80 assembler when there are   already excellent and fully-featured assembler like SJAsmPlus ?

There   is no point.
You are right, I should not release software for people   who have everything ;)
So, sorry, that I released this simple piece of   code for Linux/Mac/Windows users.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 662
  • Country: gb
  • Liked: 220
Re: Standalone Z80 Assembler in Java
« Reply #4 on: 14:23, 17 June 10 »

Good work! Can you change the font in a preference?  I hate Courier and I will actively not use software that forces its use.

Turn it into an Eclipse Perspective (as a plugin) with source code highlighting!


Anyone got an 8-bit integer based (vaguely accurate, not precise) Z80 floating point library, btw? Was going to try and do a ray caster dungeon crawler engine on the CPC. Although I have some ideas as to how to totally remove all FP math from such a creation, at the expense of quite a few lookup tables (beyond the standard SIN/TAN tables). It's just about getting the time. And not being disheartened when it finally runs at 1 fps.
« Last Edit: 14:26, 17 June 10 by Briggsy »

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.039
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1007
Re: Standalone Z80 Assembler in Java
« Reply #5 on: 14:34, 17 June 10 »
I don't use Eclipse.
I am coding with Netbeans.

Which font do you like?

BTW.: I am using "Monospaced" font.
« Last Edit: 14:37, 17 June 10 by Devilmarkus »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 662
  • Country: gb
  • Liked: 220
Re: Standalone Z80 Assembler in Java
« Reply #6 on: 21:16, 17 June 10 »
Which font do you like?

BTW.: I am using "Monospaced" font.


Depending on platform:
Consolas / Droid Sans Mono / Bitstream Vera Sans Mono / Monaco


Just having the font name configurable in the config file will do, in my opinion :-)

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 390
Re: Standalone Z80 Assembler in Java
« Reply #7 on: 06:39, 18 June 10 »
Anyone got an 8-bit integer based (vaguely accurate, not precise) Z80 floating point library, btw? Was going to try and do a ray caster dungeon crawler engine on the CPC. Although I have some ideas as to how to totally remove all FP math from such a creation, at the expense of quite a few lookup tables (beyond the standard SIN/TAN tables). It's just about getting the time. And not being disheartened when it finally runs at 1 fps.

It would be way too slow with FP maths. If you like, you can take my source code for the Wolf 3D Demo and improve on it. Just ask for the source code.

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 662
  • Country: gb
  • Liked: 220
Re: Standalone Z80 Assembler in Java
« Reply #8 on: 14:31, 18 June 10 »
It would be way too slow with FP maths. If you like, you can take my source code for the Wolf 3D Demo and improve on it. Just ask for the source code.


Cheers for the offer! I see you got textures going as well, impressive. 32x32 right? I was thinking of doing a cross between wolf3d, dungeon master and rogue, as I thought the refresh would be too low for a fps, and something like dungeon master can fill a lot of the screen with stats and static pictures!


I was going to render two pixel columns at a time (mode 0) into a buffer (of aaaabbbb format bytes), and then render them into the CPC's screen memory (abababab format bytes, via a lookup table). In my mind this is faster than rendering column by column with all the bit manipulation required for the CPC screen layout, but maybe someone with experience knows a better way.


Don't raise any hopes though, I have to find the time first!

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 390
Re: Standalone Z80 Assembler in Java
« Reply #9 on: 04:04, 23 June 10 »
Cheers for the offer! I see you got textures going as well, impressive. 32x32 right?

I think they're 16x32 MODE 0 wide pixels.

Quote
I was going to render two pixel columns at a time (mode 0) into a buffer (of aaaabbbb format bytes), and then render them into the CPC's screen memory (abababab format bytes, via a lookup table). In my mind this is faster than rendering column by column with all the bit manipulation required for the CPC screen layout, but maybe someone with experience knows a better way.

I'm not sure it would be any faster, and would require a (for 16 colours) 4K lookup table (actually, 16 x 16 byte lookup tables but they'd be 240 bytes apart). Unfortunately, you couldn't do that from zero page, you'd have to add a value (eg. #10 for ink 0), then you'd use memory locations #1010..#101F, #1110..#111F .... #1F10..#1F1F). May be worth experimenting with it though. The current code is fast for the left-hand pixel of the pair, and   slightly slower for the right. It places the left pixel with a simple LD   (HL),r type instruction, and uses OR for the right pixel.
 
 

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.551
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 816
Re: Standalone Z80 Assembler in Java
« Reply #10 on: 14:07, 30 July 10 »
Devilmarkus wrote:

I don't use Eclipse.
I am coding with Netbeans.

Which font do you like?


All assemblers should use the Data70 font (as featured in my avatar!)  ;) . Other people call it the "Computer Font" or the "60s Computer Font". Courier is a good choice though!  ;D
* Using some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.039
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1007
Re: Standalone Z80 Assembler in Java
« Reply #11 on: 15:18, 30 July 10 »
All assemblers should use the Data70 font (as featured in my avatar!)  ;) . Other people call it the "Computer Font" or the "60s Computer Font". Courier is a good choice though!  ;D

Reading source code shown with Data70 font is not very comfortable, because this font is formatted.
You need a font which has a fixed width for each char to read source codes as good as possible.

Also Java denies to show data70 ttf font.

In fact, I also don't like "courier" font or similar in forum postings ;)
They look too splitted.
Better use a "book" like font.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.551
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 816
Re: Standalone Z80 Assembler in Java
« Reply #12 on: 15:46, 30 July 10 »
Devilmarkus wrote:

Reading source code shown with Data70 font is not very comfortable, because this font is formatted.
You need a font which has a fixed width for each char to read source codes as good as possible.


Hmm yeah, just an impression I had where I thought many old computers used it. But then I made a routine to redefine the Terminal Font into that.

Also Java denies to show data70 ttf font.
 
Ah - conspiracy into refusing to accept it as a True Type Font.

In fact, I also don't like "courier" font or similar in forum postings ;)
They look too splitted.

And everything else looks the same (boring). Better get someone to remove it!
 
Better use a "book" like font.

Courier was once the font used in many books!  ??? 
* Using some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.551
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 816
Re: Standalone Z80 Assembler in Java
« Reply #13 on: 02:39, 31 July 10 »
Devilmarkus wrote:

In fact, I also don't like "courier" font or similar in forum postings ;)
They look too splitted.


Okay, okay I'll be good to you all and use Comic San MS instead.
* Using some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.785
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2826
Re: Standalone Z80 Assembler in Java
« Reply #14 on: 08:49, 02 August 10 »
The universe just collapsed.




...on the flipside, I've attached some monotype fonts I've been enjoying...

PS Btw, Courrier in books is not too bad for certain used. But it does not render well on PCs - have no idea why...

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.551
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 816
Re: Standalone Z80 Assembler in Java
« Reply #15 on: 10:25, 02 August 10 »
Gryzor wrote:

The universe just collapsed.

Better having that than another War I suppose!  ;D
* Using some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.785
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2826
Re: Standalone Z80 Assembler in Java
« Reply #16 on: 21:27, 04 August 10 »
There's no life worth living with Comic Sans.