Thanks! I'm still on VT 1.6 so will try solution #1. Is there anything special about the name .aseg, or is it treated like any other name?
Thanks, Clint On Mon, Apr 6, 2015 at 11:41 AM, Ken Pettit <[email protected]> wrote: > Hi Clint, > > There are a couple of ways to do this in the IDE (in VT 1.7). But I just > noticed a bug I need to fix with the #ifdef / #else / #endif logic. > > 1. You could define a linker region that is the exact size you want, then > allocate only the code you want in that section. > > Linker script: > CODE NAME=some_name START=0 END=255 > CODE NAME=.aseg START=256 END=2FFFh > > ASM file: > > some_name org 0 > > jmp somewhere > lxi hl, some value > ;etc. > > ; Now switch to the > .aseg org 256 > lda 14 > ; Do something useful > > > 2. You could use the '$' operator (I believe. I will test this, but it > should work) > > .org 0 > ; Add some code here > > #if $>255 > #error "Code is too big!" > #endif > > Documentation is one of the big tasks I have to tackle. For now, Q/A on > this list is the only option. > > Ken > > > On Sun, Apr 5, 2015 at 11:56 AM, Clinton Reddekop < > [email protected]> wrote: > >> Hi Ken, >> >> Is there a way that I can have the IDE check if a certain piece of code >> goes outside of a certain memory range? For example, I have some code >> starting with "org 0" and when I reach a certain point I want the location >> counter to still be < 256. >> >> It would also be nice to have a check for whether a piece of code exceeds >> a certain size, for example: >> >> limit equ (whatever) >> cstart: >> ...code here... >> cend: >> >> then have a way to check that (cend-cstart) < limit. >> >> Also (possibly related?) is there any documentation I can look at for the >> linker file format? >> >> Thanks, >> Clint >> > >
