Skip to main content
Visitor II
March 31, 2004
Question

How to define bytes in the upper ram bank (0x100-17F)?

  • March 31, 2004
  • 4 replies
  • 863 views
Posted on March 31, 2004 at 14:52

How to define bytes in the upper ram bank (0x100-17F)?

    This topic has been closed for replies.

    4 replies

    adibAuthor
    Visitor II
    March 28, 2004
    Posted on March 28, 2004 at 20:29

    Hi,

    I am trying to define a byte wide variable in the 16 bit address area of the RAM.

    When I use ''label DS.B 1'' I get:

    ''Error 84: Byte Size label has val > 255! (need WORDS?)''

    When I use ''DS.W'' it compiles but the variable is a word!

    Please advise......
    Visitor II
    March 29, 2004
    Posted on March 29, 2004 at 04:38

    If you define the 16 bit RAM section as WORD, you can the registers define as byte!

    The next code is working!

    Code:

    WORDS

    segment 'ram1' ;Registers define in RAM1 location

    ;/* Next adresses are 16 bits */

    ;/* Be carefull, the next RAM registers */

    ;/* Do not proceed commands, like */

    ;/* SLA, CLR, INC */

    Message DS.B 1 ;Message

    Visitor II
    March 29, 2004
    Posted on March 29, 2004 at 08:54

    Basically you have missed out the ''WORDS'' qualifier. It tells the assembler, ''the following bytes have to be addressed using 16-bits. You must have defined in the following way :

    segment 'ram0'

    BYTES

    temp ds.b 1

    segment 'ram1'

    label ds.b 1

    The BYTES says that label uses 8-bit addressing while it is NOT in zer page, hence the error. Adding ''WORDS'' below ''segmnet 'ram1' '' will solve your problem.
    adibAuthor
    Visitor II
    March 31, 2004
    Posted on March 31, 2004 at 14:52

    Thanks very much! it solved the problem.