Someone knows if Pasmo supports PHASE/DEPHASE?

Page 1/2
| 2

By hbarcellos

Hero (642)

hbarcellos's picture

28-03-2014, 19:47

I was looking @ http://pasmo.speccy.org/pasmodoc.html, but I was unable to find the information...
As a last resort, I can move to another assembler.
Besides SJASM and, for principles I'm trying to avoid tniASM, which other could I consider as an option?

Login or register to post comments

By Grauw

Ascended (10699)

Grauw's picture

28-03-2014, 20:25

I don’t know what you expect PHASE / DEPHASE to do (I am not familiar with those directives), but you may also consider giving Glass Z80 assembler a try.

By hbarcellos

Hero (642)

hbarcellos's picture

28-03-2014, 20:29

Well, after a not so memorable discussion about that on IRC, I learned (finally from a friend) that phase/dephase is

"you can compile (sic) as the code was in the code was in the final place"

Meaning that, if I'll move the code during execution, I can use phase $xxxx and code from one point to other will be assembled with the correct final address...

By Daemos

Paragon (2044)

Daemos's picture

28-03-2014, 22:20

Yes phase/dephase is very powerfull. If you are into very detailed large projects you really need phase/dephase.

By hbarcellos

Hero (642)

hbarcellos's picture

02-04-2014, 03:40

Grauw wrote:

I don’t know what you expect PHASE / DEPHASE to do (I am not familiar with those directives), but you may also consider giving Glass Z80 assembler a try.

Hi Grauw,
Someone on MSXBR-L raised a point about Glass.

Quote:

Section: section
Defines a section of code or data that will be assembled inside the space of a ds statement. This allows you to have nonadjacent code or data sections and group them into separate regions, such as ROM and RAM pages. The mandatory argument references the DS statement that is the target of the section.

org 4000H
ROM_PAGE1: ds 4000H
ROM_PAGE2: ds 4000H
RAM: ds VIRTUAL 3000H

SECTION ROM_PAGE1
SetValue:
ld (value),a
ret

SECTION RAM
value: db 0
ENDS
ENDS

Anyway, even not being a huge fan of Java Applications ( B-) ), I'll give it a try. I suppose it's not possible to use without a JVM installed on my machine, isnt it?
I'm also new on the phase/dephase, but, if I understood right, it's a way to make the assembler assemble the code you created assuming that the code will be run on a different location. For instance, if I have a piece of code that starts on the 2nd page of the cart but during execution that piece of code will be executed on page 0 (assuming that I would find and using RAM on that page), I could use phase/dephase to tell the assembler to consider, for that part (without adding zeros or nothing) to be assembled as if the code was on the page it will be by the time will be executed.

Best Regards,

By hbarcellos

Hero (642)

hbarcellos's picture

02-04-2014, 03:42

Maybe it could be possible with Pasmo, but, after quickly trying to find that information on the manual, I quickly adjusted the addresses using some arithmetic operators, like:

call rotine1-destination_in_ram

Herculean effort, but, it works! Smile

By NYYRIKKI

Enlighted (6016)

NYYRIKKI's picture

02-04-2014, 07:15

I don't know about Pasmo, but before I learned PHASE I used something like:

	LD HL,TOUP_START
	LD DE,UP_START
	LD BC,UP_END-UP_START
	LDIR
	JP TOUP_END

TOUP_START:
	ORG #C000
UP_START:

	.
	.
	.
UP_END:
	ORG TOUP_START+UP_END-UP_START
TOUP_END:	

	RET

Using multiple ORG's may cause warnings, but it should work...

By Grauw

Ascended (10699)

Grauw's picture

02-04-2014, 11:36

Pasmo can’t do that, because the address counter is not separate from the file counter. So, the address the code is compiled for determines the location of the code in the output file. I think is is a big flaw of Pasmo, I submitted a patch to change it but heard nothing back, I think the project is abandoned.

In any other assembler, definitely I would recommend checking the “ORG juggling” method suggested by NYYRIKKI. Clever use of ORG can be really powerful. Also in combination with DS and some maths to do alignment and padding.

The Glass SECTION feature allows you to interleave different sections of code, e.g. bits of code / data intended for ROM and RAM interleaved in the same file. Originally I was using NYYRIKKI’s method, but then I implemented SECTION because it gave me more freedom about how I could organise my code.

By hbarcellos

Hero (642)

hbarcellos's picture

02-04-2014, 15:49

@NYYRIKKI and Grauw, yep, using that in Pasmo includes '00's from TOUP_START to #c000 - 4000 wich I used as the initial org on my test.
I can really remember why I choose PASMO in 2008.
After finishing all the adjustments on the conversions for the Multicart, I'll migrate to another one.

By hbarcellos

Hero (642)

hbarcellos's picture

02-04-2014, 19:41

@Grauw, please pardon the bias, but...
- remember, this is an ironic post... under any circumstances it should be considered a critic to Glass and/or Grauw!!

Quote:

D:\tempC>java -jar glass-0.3.jar ..\tempB\Tutankham\coleco_sound_emu.asm
Exception in thread "main" java.lang.UnsupportedClassVersionError: nl/grauw/glass/Assembler : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: nl.grauw.glass.Assembler. Program will exit.

Shocked! Shocked!
Grrrrrrrrrrrrrr, it's always like that!
Reminds me when my kids keep asking me to install a MOD on their Minecraft installation!!! I have already faced all kind of headache with that. Or worst, when coders start complaining about Websphere/JBOSS or any other of those strange layers that I don't fully understand. All I know is that there's always a strange problem with unknown cause that could be easily solved by installing the latest version from IBM or RedHat!!!!!!!!

It's not possible to compile it, generate some real ASM coding with it and run it without those "cute-sandbox" JVM?

By Manuel

Ascended (19273)

Manuel's picture

02-04-2014, 19:56

Just get a Java 7 JVM... not something old Smile

Page 1/2
| 2