emustudio / emuStudio

Universal emulation platform and framework.
https://www.emustudio.net/
GNU General Public License v3.0
40 stars 9 forks source link

Compilation error: Unknown identifier #279

Closed lfmm-brz closed 1 year ago

lfmm-brz commented 1 year ago

I am doing something wrong? If data to be loaded on a register is greater than 1Fh for example A0h, I receive "[Error ] Compilation error: [13,4] Unknown identifier: A0H".

Java version, MX Linux. MITS Altair 8800 (Z80). GUI.

My code:

ORG 0000H

    LD A, A0H

NEXTI: LD (INUM),A LD A,1BH NEXTJ: LD (JNUM),A LD A,(JNUM) DEC A JR NZ,NEXTJ LD A,(INUM) DEC A JR NZ,NEXTI HALT

INUM: DB 0 JNUM: DB 0

Compiling started... [Info ] Zilog Z80 Assembler, version 0.40 [Error ] Compilation error: [13,4] Unknown identifier: A0H Compiling has finished.

Thank you a lot.

Sorry if this is a dumb doubt.

vbmacher commented 1 year ago

Hi @lfmm-brz, the problem is the hex number A0h is valid identifier, because it starts with a letter (see documentation). So the following code is perfectly valid:

jp A0h

A0h: hlt

In this case the jmp references existing label A0h, defined below. In your case however there is no definition of such identifier, so the code fails to compile.

Hexadecimal numbers must always begin with number, so for your case that would be 0A0h