Re: [cc65] Best way to get aligned memory...

Date view Thread view Subject view

From: Christian Krüger (christian.krueger_at_pace.de)
Date: 2003-01-13 10:20:21


Good morning!

Maybe a very silly question, but when I have to use assembler
to get aligned memory efficiently , why doesn't work the following
(or does it work?):

-8<--------------------------------------------------------------
	.export _buffer

BUFSIZE         = 1024
BUFALIGN        = 4             ; Must be a power of 2

.bss
.align	BUFALIGN
_buffer:	.res	BUFSIZE

-8<--------------------------------------------------------------

looks IMHO a little bit more 'straight forward' than

> _buffer = (buf + BUFALIGN - 1) .AND (~(BUFALIGN - 1) .AND $FFFF)

Regards
chrisker
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-01-13 10:20:49 CET