Forum
asm/endasm DEFB not accepting 0xFE or FEh instead of 254 - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16)
+---- Thread: asm/endasm DEFB not accepting 0xFE or FEh instead of 254 (/showthread.php?tid=380)



asm/endasm DEFB not accepting 0xFE or FEh instead of 254 - nitrofurano - 10-06-2011

hi!
i always had some idea that z80 assemblers accepts byte values in hexadecimal format, instead of only decimals - i'm i wrong, or is this zxbasic compiling missing this feature? (or can we suggest this feature?)

Code:
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $ zxb.py -t -B -a asm.bas Generating LALR tables
WARNING: Token 'BIN' defined, but not used
WARNING: There is 1 unused token
Generating LALR tables
WARNING: Token 'UMINUS' defined, but not used
WARNING: There is 1 unused token
asm.bas:2: Error: Syntax error. Unexpected token 'x00' [ID]
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $ zxb.py -t -B -a asm.bas
Generating LALR tables
WARNING: Token 'BIN' defined, but not used
WARNING: There is 1 unused token
Generating LALR tables
WARNING: Token 'UMINUS' defined, but not used
WARNING: There is 1 unused token
asm.bas:3: Error: Undefined label 'ffh'
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $

Code:
asm
DEFB 0,1,2,3,4,5,6,7
DEFB 00h,01h,02h,03h,04h,05h,06h,07h
DEFB 0xff,0xfe,0xfd,0xfc,0xfb,0xfa,0xf9,0xf8
end asm



Re: asm/endasm DEFB not accepting 0xFE or FEh instead of 254 - boriel - 10-06-2011

nitrofurano Wrote:hi!
i always had some idea that z80 assemblers accepts byte values in hexadecimal format, instead of only decimals - i'm i wrong, or is this zxbasic compiling missing this feature? (or can we suggest this feature?)

Code:
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $ zxb.py -t -B -a asm.bas Generating LALR tables
WARNING: Token 'BIN' defined, but not used
WARNING: There is 1 unused token
Generating LALR tables
WARNING: Token 'UMINUS' defined, but not used
WARNING: There is 1 unused token
asm.bas:2: Error: Syntax error. Unexpected token 'x00' [ID]
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $ zxb.py -t -B -a asm.bas
Generating LALR tables
WARNING: Token 'BIN' defined, but not used
WARNING: There is 1 unused token
Generating LALR tables
WARNING: Token 'UMINUS' defined, but not used
WARNING: There is 1 unused token
asm.bas:3: Error: Undefined label 'ffh'
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $
NOTE: To remove these warnings, enter your zxb.py directory and type ./zxb.py to create the static cache. These warnings should not appear anymore.
nitrofurano Wrote:
Code:
asm
DEFB 0,1,2,3,4,5,6,7
DEFB 00h,01h,02h,03h,04h,05h,06h,07h
DEFB 0xff,0xfe,0xfd,0xfc,0xfb,0xfa,0xf9,0xf8
end asm
The 0xNNN format is not allowed. Use $NNN format or NNNh format.
E.g.
Code:
$C9 <-- Allowed
1Fh <-- Allowed
FFh <-- Error. "FFh" is an identifier. Prefix with "0"
0FFh <-- Ok. Now allowed.
0xC9 <-- Not allowed



Re: asm/endasm DEFB not accepting 0xFE or FEh instead of 254 - nitrofurano - 10-06-2011

thanks! Smile