Re: [cc65] Macros in ca65

From: Karri Kaksonen <karri1sipo.fi>
Date: 2011-12-12 07:07:52
On 12/12/2011 01:03 AM, Ullrich von Bassewitz wrote:
> On Sun, Dec 11, 2011 at 10:02:07PM +0200, Karri Kaksonen wrote:
>> It would help me a lot to have at least most of the BLL macros
>> available. Right now I have to include BLL code as binary blobs.
>> Having similar macros would allow me to include them as source. It
>> would help a lot to make compilation carts this way.
> Why do you need them builtin instead of just an include file? How Lynx
> specific are they?
>
> Regards
>
>
>          Uz
>
>

Well, they should not be Lynx specific at all. I just hope someone would 
implement structural code like if, else, then, while, switch/case etc.

Here are some examples taken from my Ottelo asm game (a 1k programming 
contest):

FlipFlag ds 1

.loop
   .. code to do something
   _IFNE FlipFlag
     bra .loop
   _ENDIF

lda sound_channel_busy
_IFEQ
   lda #<abcmusic0
   ldy #>abcmusic0
   ldx #0
_ENDIF

cmp pos
_IFEQ
   lda #CursorBkg
_ELSE
   lda #PegBkg
_ENDIF

lda board,x
_SWITCH
_CASE
   lda #PlayerCol
_CASE #1
   lda #ComputerCol
_ELSES
   ... lots of code
_ENDS

ror
_IFCS
   sei
   lda #2
   sta $fff9
   brk #0
_ENDIF

cmp sound_channel_max_volume,x
_IFLO
   ; attack time
   clc
   adc abc_instrument_incr,x
_ENDIF

lda length
_WHILENE
   ... code
   dec length
_WEND

For me it is not important that the commands have exactly this syntax. 
But I really hope to have a good set of structural macros available to 
make assembler coding easier for me. My thoughts are closer to 
structural C-programming than pure assembler. I understand my own code 
much better if I can use macros like these.

In normal coding I will stick to C. But sometimes I want to participate 
in 1k competitions and then it would be nice to be able to code 
efficiently in asm.
--
Regards,

Karri

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Dec 12 07:08:06 2011

This archive was generated by hypermail 2.1.8 : 2011-12-12 07:08:10 CET