10.4. Where did the output go?

If you compile the previous segment examples you will find that it produces no output. So where did the code go? The answer is nowhere - we defined segments but didn't direct their content anywhere. However we can still see their content using the -bytedump option on the command line when running KickAsssembler. That will generate the file 'ByteDump.txt' with the bytes of the segments. The example from the previous section looks like this:

******************************* Segment: Default *******************************
***************************** Segment: MySegment1 ******************************
[Unnamed]
4000: a2 1e     - ldx #30
4002: ee 21 d0  - inc $d021 
4005: ca        - dex
4006: d0 fa     - bne l1
4008: ee 20 d0  - inc $d020
400b: 4c 08 40  - jmp *-3
***************************** Segment: MySegment2 ******************************
[MySegment2]
1000: ee 21 d0  - inc $d021
1003: 4c 00 10  - jmp *-3

The simplest way of getting the code to a program file is to specify a 'outPrg' parameter:

        .segment Code [outPrg="colors.prg"]

        *=$1000
        inc $d020
        jmp *-3

If you use the 'outBin' parameter instead a binary file will be output. In the output chapter you can see more options for outputting segments to files or disks images.