Re: LZ: ZShell to Usgard converter?


[Prev][Next][Index][Thread]

Re: LZ: ZShell to Usgard converter?



 Acutally, I think somthing like this may be possible. There'd be two ways
to go about this. Does anyone know if TASM supports the preprocessor
commands #undef, #ifdef, #elseif and #endif?
 If it does, then you could simeply put 
#define ZSHELL
#define USGARD
#undef USGARD ; turn off usgard version (ie compile for zshell)

then you code..
#ifdef ZSHELL
ld hl, sprite
ld de, (PROGRAM_ADDR)
add hl, de
#elseif
ld hl, &sprite
#endif

this would work if TASM supports the full range of preprocessor commands

Otherwise, a simple program that could go through and locate all instances
of ld hl, whatever flowed by ld de, (P...) / add hl,de
the problem would be if you had code that added the two a bunch of times,
but only did ld de, (pr..) once
						                 Erik Huizing
						     ehuizing@acs.ucalgary.ca
					     http://www.ucalgary.ca/~ehuizing

On Wed, 16 Jul 1997, Teemu Kontkanen wrote:

>I don't think so. Mainly because ld de,(PROGRAM_ADDR), add hl,de  is 
>some bytes longer than ld  &, . So it would mess up all relative 
>jumps. Of course, the program could try to fix them also; but it can 
>never know if it really is code and not data. So the results might 
>not be very good. And it's rather easy to convert old programs 
>manually.


Follow-Ups: References: