Is there somewhere the different ORG/ORGH and RES stuff is documented? I don't really know how to use the ORGH part, though I tend to know what ORG/RES does from P1.
Is there somewhere the different ORG/ORGH and RES stuff is documented? I don't really know how to use the ORGH part, though I tend to know what ORG/RES does from P1.
In the instructions.txt file, there is some explanation at the end:
-----
notes
-----
A symbol declared under ORGH will return its hub address when referenced.
A symbol declared under ORG will return its cog address when referenced,
but can return its hub address, instead, if preceded by '@':
COGINIT #0,#@newcode
For immediate-branch and LOC address operands, "#" is used before the
address. In cases where there is an option between absolute and relative
addressing, the assembler will choose absolute addressing when the branch
crosses between cog and hub domains, or relative addressing when the
branch stays in the same domain. Absolute addressing can be forced by
following "#" with "\".
CALLPA/CALLPB/DJZ..JNXRL/JNATN/JNQMT - rel_imm9/ind_reg20
JMP/CALL/CALLA/CALLB/CALLD - abs_imm20/rel_imm20/ind_reg20
LOC - abs_imm20/rel_imm20
If a constant larger than 9 bits is desired in an instruction, use "##",
instead of "#" to invoke AUGS/AUGD:
AND address,##$FFFFF
DJNZ reg,##far_away
The following assembler directives exist:
ORGH {hub_address}
Set hub mode and an optional address to fill to with $00 bytes.
ORG {cog_address {,cog_address_limit}}
Set cog mode with optional cog address and limit. Defaults to $000,$200.
If $200..$3FF used for cog address, LUT range selected. Doesn't generate
any data.
ORGF cog_address
Fill to cog_address with $00 bytes. Must be in cog mode.
RES {cog_registers}
Reserve cog registers. Defaults to 1. Doesn't generate any data. Must be
in cog mode.
FIT {cog_address}
Make sure cog code fits within cog address.
ALIGNW/ALIGNL
Align to next word/long in hub. Must be in hub mode.
BYTE data{[count]}{,data{[count]}...}
WORD data{[count]}{,data{[count]}...}
LONG data{[count]}{,data{[count]}...}
Generate byte/word/long data with optional repeat count.
Comments
if you ORGH ahead, it fills memory with $00 bytes which will be downloaded. You could also do:
Anything you do like that fills memory with values and will be downloaded.
In the instructions.txt file, there is some explanation at the end: