t-edson / P65Pas

CPU 6502 Pascal Compiler/IDE/Debugger
GNU General Public License v3.0
119 stars 27 forks source link

Problem in evaluating the constants #59

Closed Squall-FF8 closed 1 year ago

Squall-FF8 commented 1 year ago
const
  spr1_Address1 = 1 << 15;

This code generate error: Dialog[25,5] Error: Numeric value exceeds a byte range.

t-edson commented 1 year ago

"byte << byte" is expected to generate a byte in the compiler. so it generates a range error. Use this:

const
  spr1_Address1 = word(1) << 15;