Skybuck Flying <spam.TakeThisOut@hotmail.com> kirjoitti 23.12.2007:
>
> CURLINE works in CoreWin 2.3 too
> However it's only usefull if I want to know the currentline.
> What if I wanted to know the absolute line of somewhere else.
Try "(CURLINE+label)", where "label" is a label placed on the other
line. I'm not sure what you want this for, but it's there.
Similarly, if you want the relative address of "lineA" as seen from
"lineB", just use "(lineA-lineB)". This tends to be somewhat more
useful in practice, e.g. if you need to reset a pointer that resides
on some other instruction ("lineB" in this example).
Note that "lineA" and "lineB" don't have to be labels, they just need
to be expressions that point to the appropriate instructions when used
on the current line; see e.g. the line:
find mov.ab #sorg-1-kill, kill ; redirect clear
in <http://vyznev.net/corewar/planar/TimeLag.red>, which resets the
clear pointer on the line "kill" to point to "sorg-1" (or, rather,
"sorg-1+N*step", where N is the number of scans executed so far),
where "sorg" in turn is defined as:
step equ 3030 ; mod-10
sorg equ (stun-step) ; scan origin
and "stun" is a label. Similarly, the B-value "cend-kill" on the line
labelled "cbmb" ensures that, if the clear hits its own pointer (on
the line "kill"), it will skip to the line "cend" (which, as it
happens, is here defined as "(cbmb+1)").
--
Ilmari Karonen
To reply by e-mail, please replace ".invalid" with ".net" in address.
>> Stay informed about: Odp: CoreWin needs some sort of absolute constants.