Author Topic: compiletime errors  (Read 7246 times)

0 Members and 1 Guest are viewing this topic.

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
compiletime errors
« on: May 08, 2011, 03:10:54 pm »
Hi everybody!

I recently started with asm, and i have some compiletime errors of which i don't know how to solve them.

my code:
Code: [Select]
InitView:
  ;call once every frame, before 3DTo2D
  ld hl, (xto)
  ld bc, hl
  ld hl, (xfrom)
  ld de, hl
  call SubFP
  ld hl, de
  ld (xto), hl
  ld hl, (yto)
  ld bc, hl
  ld hl, (yfrom)
  ld de, hl
  call SubFP
  ld hl, de
  ld (yto), hl
  ld hl, (zto)
  ld bc, hl
  ld hl, (zfrom)
  ld de, hl
  call SubFP
  ld hl, de
  ld (zto), hl
  ld hl, (xto)
  ld bc, hl
  call MulFP
  ld ix, de
  ld hl, (yto)
  ld bc, hl
  call MulFP
  ld hl, de
  ld bc, ix
  add hl, bc
  ld ix, hl
  ld hl, (zto)
  ld bc, hl
  call MulFP
  ld hl, de
  ld de, ix
  add hl, de
  call sqrtFP
  ld de, hl
  ld hl, (xto)
  push de
  call DivFP
  pop de
  ld (xto), hl
  push de
  ld hl, (yto)
  call DivFP
  pop de
  ld (yto), hl
  ld hl, (zto)
  call DivFP
  ld (zto), hl
  ld hl, (xto)
  ld bc, hl
  ld hl, (xup)
  call MulFP
  ld ix, de
  ld hl, (yto)
  ld bc, hl
  ld hl, (yup)
  call MulFP
  ld hl, de
  ld bc, ix
  add hl, bc
  ld ix, hl
  ld hl, (zto)
  ld bc, hl
  ld hl, (zup)
  call MulFP
  ld hl, af
  add hl, de
  push hl
  ld hl, (xto)
  ld bc, hl
  pop hl
  push hl
  call MulFP
  ld hl, (xup)
  ld bc, hl
  call SubFP
  ld hl, de
  ld (xup), hl
  ld hl, (yto)
  ld bc, hl
  pop hl
  push hl
  call MulFP
  ld hl, (yup)
  ld bc, hl
  call SubFP
  ld hl, de
  ld (yup), hl
  ld hl, (zto)
  ld bc, hl
  pop hl
  call MulFP
  ld hl, (zup)
  ld bc, hl
  call SubFP
  ld hl, de
  ld (zup), hl
the errors:
Assembling...
Pass 1 complete. (330ms).
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:61]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:63]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:65]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:68]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:70]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:72]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:75]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:77]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:79]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:82]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:84]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:86]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:88]
Error: Could not parse expression 'ix' (Invalid number). [zztemp.asm:89]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:91]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:93]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:95]
Error: Could not parse expression 'ix' (Invalid number). [zztemp.asm:96]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:99]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:114]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:117]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:119]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:122]
Error: Could not parse expression 'ix' (Invalid number). [zztemp.asm:123]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:125]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:127]
Error: Could not parse expression 'af' (Invalid number). [zztemp.asm:130]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:134]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:139]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:141]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:144]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:149]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:151]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:154]
Error: Could not parse expression 'hl' (Invalid number). [zztemp.asm:158]
Error: Could not parse expression 'de' (Invalid number). [zztemp.asm:160]
Pass 2 complete. (163ms).
Errors: 36, Warnings: 0.
Build failed.

My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: compiletime errors
« Reply #1 on: May 08, 2011, 03:26:12 pm »
Whoa... Seems like you're not assembling for Z80. What assembler are you using? Make sure you're using either TASM (with tasm80.tab table file), ZDS, or Spasm.

And welcome to Omnimaga, ben_g :)
« Last Edit: May 08, 2011, 03:26:28 pm by Deep Thought »




Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: compiletime errors
« Reply #2 on: May 08, 2011, 03:38:24 pm »
What assembler are you using?
I use latenite z80 editor for both editing and compiling.
And welcome to Omnimaga, ben_g :)
thanks

btw: thanks for the quick reply
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Ashbad

  • Guest
Re: compiletime errors
« Reply #3 on: May 08, 2011, 03:42:24 pm »
yeah, whatever you're doing, the syntax the assembler expects is not present.  I would read the documentation for latenite z80 and/or get a better assembler ;)

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: compiletime errors
« Reply #4 on: May 08, 2011, 03:45:22 pm »
I hope that's not your entire source code. It needs some header and footer stuff to assemble correctly. Also, Latenite is not being actively developed and might be a little buggy.
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: compiletime errors
« Reply #5 on: May 08, 2011, 03:51:43 pm »
the doorscs assembler gives the same errors

the strangest abouth this: all of the other routines works (i only posted the part that gave the errors) while some of those lines are exactely the same as the ones that give errors in the initView routine
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: compiletime errors
« Reply #6 on: May 08, 2011, 03:55:48 pm »
If I remember, Doors CS SDK pretty much includes Latenite, but I could be wrong. I unfortunately cannot help you, though, because I only ever used TASM when I tried learning assembly and it doesn't run on 64 bit OSes.

Welcome on the forums by the way.

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: compiletime errors
« Reply #7 on: May 08, 2011, 04:03:42 pm »
I only ever used TASM when I tried learning assembly and it doesn't run on 64 bit OSes.
that's why i searched for other assemblers, and i got latenite to work, untill it gave those errors...
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: compiletime errors
« Reply #8 on: May 08, 2011, 04:13:02 pm »
Maybe Latenite requires you to use a table file or something? I've never used it, so I'm not sure.

Try using Spasm. It's the easiest to use I've found so far, and it's being actively developed.




Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: compiletime errors
« Reply #9 on: May 08, 2011, 04:23:00 pm »
pretty much the same...

Pass one...
Pass two...
source/invasion.z80:60: error: 'hl' isn't a macro or label
source/invasion.z80:62: error: 'hl' isn't a macro or label
source/invasion.z80:64: error: 'de' isn't a macro or label
source/invasion.z80:67: error: 'hl' isn't a macro or label
source/invasion.z80:69: error: 'hl' isn't a macro or label
source/invasion.z80:71: error: 'de' isn't a macro or label
source/invasion.z80:74: error: 'hl' isn't a macro or label
source/invasion.z80:76: error: 'hl' isn't a macro or label
source/invasion.z80:78: error: 'de' isn't a macro or label
source/invasion.z80:81: error: 'hl' isn't a macro or label
source/invasion.z80:83: error: 'de' isn't a macro or label
source/invasion.z80:85: error: 'hl' isn't a macro or label
source/invasion.z80:87: error: 'de' isn't a macro or label
source/invasion.z80:88: error: 'ix' isn't a macro or label
source/invasion.z80:90: error: 'hl' isn't a macro or label
source/invasion.z80:92: error: 'hl' isn't a macro or label
source/invasion.z80:94: error: 'de' isn't a macro or label
source/invasion.z80:95: error: 'ix' isn't a macro or label
source/invasion.z80:98: error: 'hl' isn't a macro or label
source/invasion.z80:113: error: 'hl' isn't a macro or label
source/invasion.z80:116: error: 'de' isn't a macro or label
source/invasion.z80:118: error: 'hl' isn't a macro or label
source/invasion.z80:121: error: 'de' isn't a macro or label
source/invasion.z80:122: error: 'ix' isn't a macro or label
source/invasion.z80:124: error: 'hl' isn't a macro or label
source/invasion.z80:126: error: 'hl' isn't a macro or label
source/invasion.z80:129: error: 'af' isn't a macro or label
source/invasion.z80:133: error: 'hl' isn't a macro or label
source/invasion.z80:138: error: 'hl' isn't a macro or label
source/invasion.z80:140: error: 'de' isn't a macro or label
source/invasion.z80:143: error: 'hl' isn't a macro or label
source/invasion.z80:148: error: 'hl' isn't a macro or label
source/invasion.z80:150: error: 'de' isn't a macro or label
source/invasion.z80:153: error: 'hl' isn't a macro or label
source/invasion.z80:157: error: 'hl' isn't a macro or label
source/invasion.z80:159: error: 'de' isn't a macro or label
Done
Assembly time: 0.021 seconds
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: compiletime errors
« Reply #10 on: May 08, 2011, 05:01:27 pm »
Many of your instructions aren't valid.

Code: [Select]
InitView:
  ;call once every frame, before 3DTo2D
  ld hl, (xto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  ld hl, (xfrom)
  ld de, hl ; 16-bit register-to-register transfer illegal
  call SubFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld (xto), hl
  ld hl, (yto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  ld hl, (yfrom)
  ld de, hl ; 16-bit register-to-register transfer illegal
  call SubFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld (yto), hl
  ld hl, (zto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  ld hl, (zfrom)
  ld de, hl ; 16-bit register-to-register transfer illegal
  call SubFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld (zto), hl
  ld hl, (xto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  call MulFP
  ld ix, de ; 16-bit register-to-register transfer illegal
  ld hl, (yto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  call MulFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld bc, ix ; 16-bit register-to-register transfer illegal
  add hl, bc
  ld ix, hl ; 16-bit register-to-register transfer illegal
  ld hl, (zto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  call MulFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld de, ix ; 16-bit register-to-register transfer illegal
  add hl, de
  call sqrtFP
  ld de, hl ; 16-bit register-to-register transfer illegal
  ld hl, (xto)
  push de
  call DivFP
  pop de
  ld (xto), hl
  push de
  ld hl, (yto)
  call DivFP
  pop de
  ld (yto), hl
  ld hl, (zto)
  call DivFP
  ld (zto), hl
  ld hl, (xto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  ld hl, (xup)
  call MulFP
  ld ix, de ; 16-bit register-to-register transfer illegal
  ld hl, (yto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  ld hl, (yup)
  call MulFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld bc, ix ; 16-bit register-to-register transfer illegal
  add hl, bc
  ld ix, hl ; 16-bit register-to-register transfer illegal
  ld hl, (zto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  ld hl, (zup)
  call MulFP
  ld hl, af ; 16-bit register-to-register transfer illegal, and ridiculous
  add hl, de
  push hl
  ld hl, (xto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  pop hl
  push hl
  call MulFP
  ld hl, (xup)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  call SubFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld (xup), hl
  ld hl, (yto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  pop hl
  push hl
  call MulFP
  ld hl, (yup)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  call SubFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld (yup), hl
  ld hl, (zto)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  pop hl
  call MulFP
  ld hl, (zup)
  ld bc, hl ; 16-bit register-to-register transfer illegal
  call SubFP
  ld hl, de ; 16-bit register-to-register transfer illegal
  ld (zup), hl
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: compiletime errors
« Reply #11 on: May 09, 2011, 09:27:48 am »
Oh wow, I didn't actually read the code... Yeah, you can't load a 16-bit reg into another 16-bit reg. You have to load the individual 8-bit regs, as in ld h,d \ ld l,e.




Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: compiletime errors
« Reply #12 on: May 09, 2011, 09:28:30 am »
If you reeeeeeally wanted to you could write macros for it. That could let you use those for some slightly faster typing in the future :P
« Last Edit: May 09, 2011, 09:28:55 am by ZippyDee »
There's something about Tuesday...


Pushpins 'n' stuff...


Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: compiletime errors
« Reply #13 on: May 09, 2011, 10:22:59 pm »
Note that LD BC,(abc) is faster and smaller than LD HL,(abc) / LD B,H / LD C,L.

Also note that in some cases you might be able to use EX DE,HL instead of LD.  LD HL,(abc) / EX DE,HL is the same size and speed as LD DE,(abc).

Also also note that while there are undocumented instructions to load the two halves of IX to and from other registers, those instructions don't work on buggy emulators like the Nspire.  So for compatibility you should probably stick to using, e.g., PUSH DE / POP IX to load DE into IX.

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: compiletime errors
« Reply #14 on: May 10, 2011, 01:40:14 pm »
thanks everybody
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated