OK, that was very helpful. I understand how the pragmas fit into this and I think I understand the idea behind using labels/directives to assign values; if I'm understanding right, this would be equivalent to declaring/defining variables (int, char, short, float, etc.) in C, where referencing the variable name itself produces its memory address (like if you were to use the & address operator in C) and referencing the variable name in brackets produces the value assigned to that address. I can understand this for single assignments (although I gather that you can assign more than one value of the same size in the same label by separating the values with commas), but is there a way to produce an array of a given size? Would it be correct to use defs, then relative addressing for each element of that block of bytes?
I think I've answered the questions I had about larger assembly-only binaries than expected reading about the --no-crt command line switch, which also requires manual assignment of the memory map and a separate step to make the HEX file, which is fair enough. But it does raise another question. If we take the example of a program from the first chapter of Leventhal, using the --no-crt option, I'd write it like this:
"zmap.asm"
SECTION CODE
org 0x8000
SECTION DATA
org 0xa000
"test.asm"
SECTION CODE
PUBLIC start
start:
ld a,(foo)
ld b,a
ld a,(bar)
add a,b
ld (baz),a
ret
SECTION DATA
foo: defb 3
bar: defb 4
baz: defb 0
This allows me to easily locate the input and output values for the program, with foo being assigned to $a000, bar to $a001 and baz to $a002. I'm wondering if there's a way to do something similar when using the crt, since I've tried setting the org parameter, but this doesn't seem to work for me.