News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Devilmarkus

Standalone Z80 Assembler in Java

Started by Devilmarkus, 12:36, 15 June 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Devilmarkus

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

Targhan

Unless I missed something, what's the point in a Z80 assembler when there are already excellent and fully-featured assembler like SJAsmPlus ?
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

arnoldemu

Quote from: Targhan on 11: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 ?
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

Devilmarkus

Quote from: Targhan on 11: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 ?

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

Sykobee (Briggsy)

#4

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.

Devilmarkus

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

Which font do you like?

BTW.: I am using "Monospaced" 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

Sykobee (Briggsy)

Quote from: Devilmarkus on 12:34, 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 :-)

Executioner

Quote from: Briggsy on 12:23, 17 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.

Sykobee (Briggsy)

Quote from: Executioner on 04:39, 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!

Executioner

Quote from: Briggsy on 12:31, 18 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.

QuoteI 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.
 
 

AMSDOS

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 the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Devilmarkus

Quote from: CP/M User on 12:07, 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

AMSDOS

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 the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

AMSDOS

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 the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Gryzor

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

AMSDOS

Gryzor wrote:

The universe just collapsed.

Better having that than another War I suppose!  ;D
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Gryzor

There's no life worth living with Comic Sans.

Powered by SMFPacks Menu Editor Mod