Resource centre for ZX Spectrum games
      using Manic Miner and Jet Set Willy game engines

 

Archive of the

Manic Miner & Jet Set Willy Yahoo! Group

messages

 

 

 

Message: 5489

Author: john_elliott_uk

Date: 12/02/2006

Subject: Re: How best to represent hexadecimal?

 

--- In manicminerandjetsetwilly@yahoogroups.com, andrewbroad
wrote:

> The possibilities I'm considering include:
>
> (a) &DE. I like the idea of having a one-character non-alphanumeric
> symbol as a prefix, as long as there's no ambiguity with the use of
> & as the bitwise-AND operator. Unfortunately if you type &DE on a
> command-line, it strips off the & unless you type "&DE".

Depends on the command line. In UNIX shells, it runs the task in the
background.

> (e) DEh (as seen in assemblers, along with 222t for denary,
> 11011110y for binary and 336o for octal). But this is long-winded,
> and again could be misinterpreted as a variable-name unless written
> as 0DEh - yuck!

No Z80 assembler I've used allows hex numbers in this form to start
with a letter, so if you want something that actually assembles you'd
have to include the leading zero.

> (f) DE_16 (_ represents that 16 is a subscript). Too long-winded.

and not ASCII-friendly.

> -----------------
> 128K memory-banks
> -----------------
>
> My hex-notation will also have to interact with my bank-notation
> (when I implement SPECSAISIE's model of 128K memory).
>
> e.g. John Elliott wrote "C300h in bank 3"
>
> 3:C300h
> &3:C300 }
> 3:&C300 } ditto re. $ and #
> Ox3:C300
> 3:0xC300

etc.
Since the bank is always in the range 0-7 and therefore looks the
same in denary, hex and octal, putting the indicator on the side with
the bank number rather than the address might cause confusion. And if
you used a convention that addresses formed b:xxxx were hexadecimal,
and addresses formed b:nnnnn were hex, you wouldn't need any other
indicator.

> Hex 5:86B0: C3 CA 87
> (5: is unnecessary in this example

and incorrect; 86B0h is in bank 2 (or sometimes bank 6 on the +3,
but to my knowledge no-one's written a JSW that uses the 64k RAM
configurations).

 

 

arrowleft
arrowright