[Coco] questions about constants

Arthur Flexser flexser at fiu.edu
Sat Sep 12 21:37:54 EDT 2009


These are not opcodes, which may explain why you had trouble finding
them--they wouldn't appear in a table of opcodes.  They are
"pseudo-ops"--assembler commands that don't themselves assemble into any
bytes, but instead tell the assembler to do something.  So, if you simply
want the byte $20, say, to be included in the assembler output at some
location you've given the label "HERE" to, you'd put

HERE      FCB  $20

Or, to do this with the double byte $1234, you'd use

HERE     FDB   $1234

I've don't recollect hearing of FCS--it may be a pseudo-op that only some
assemblers recognize.   FCC is the thing that is generally used for strings:

HERE    FCC /Put this string here./

Probably some assemblers only allow a single data character after FCC and
demand that FCS be used when multiple characters are desired.

Generally, you'd these someplace that does not contain executable
instructions, like after an RTS, to include data values that you want your
program to have access to.

Art

On 9/12/09, Wayne Campbell <asa.rand at yahoo.com> wrote:
>
> I have looked at a dozen tutorials on assembly language programming. None
> of them address the op codes fcb, fcc or fcs, so I'm asking the assembly
> gurus on this list to help explain this to me.
>
> What are the differences between fcb, fcc and fcs?
> Is there a fci or fcr(/f/d) (for integer and real(/float/double) values)?
>
> I know that:
>
>   fcb = form constant byte   = any constant numeric byte value?
>   fcc = form constant char   = any constant character that is displayable?
>   fcs = form constant string = any constant string?
>
> Are the following equivalent, so far as the assembler is concerned?
>
> A. form constant byte:
>
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $20
>   fcb   $42 B
>   fcb   $41 A
>   fcb   $53 S
>   fcb   $49 I
>   fcb   $43 C
>   fcb   $30 0
>   fcb   $39 9
>   fcb   $0A
>
> B. form constant string:
>
>   fcs   /            BASIC09/
>   fcb   $0A
>
> C. would using form constant char be equivalent?
>
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   ' '
>   fcc   'B'
>   fcc   'A'
>   fcc   'S'
>   fcc   'I'
>   fcc   'C'
>   fcc   '0'
>   fcc   '9'
>   fcb   $0A
>
> Wayne
>
>
>
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>



More information about the Coco mailing list