FAQ  •  Register  •  Login

ASM features EQU and DEFM

<<

LCD

Posts: 568

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Tue Nov 01, 2011 12:59 am

ASM features EQU and DEFM

Hi Boriel. I just adapted a ASM routine for key-redefining from WOS Forum to ZXBC for my next game, and noticed following:
EQU is not supported?
DEFM supports only Strings, but not mixed bytes+strings in one line like: DEFM 14,10,5,"Down",255
I adapted the lines by lacerating them to DEFB,DEFM and DEFB again, but maybe it would be a good idea to support bytes and Strings with DEFM, like other assemblers do.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
<<

boriel

Site Admin

Posts: 1274

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Nov 01, 2011 1:23 am

Re: ASM features EQU and DEFM

LCD wrote:Hi Boriel. I just adapted a ASM routine for key-redefining from WOS Forum to ZXBC for my next game, and noticed following:
EQU is not supported?


EQU is supported. It should be used this way (if I recall correctly).

  Code:
Asm
Label EQU 5 * OtherLabel  + 3 ; Complex expressions allowed
End Asm

LCD wrote:DEFM supports only Strings, but not mixed bytes+strings in one line like: DEFM 14,10,5,"Down",255
I adapted the lines by lacerating them to DEFB,DEFM and DEFB again, but maybe it would be a good idea to support bytes and Strings with DEFM, like other assemblers do.

Ok, I will try to add that in 1.2.9
<<

LCD

Posts: 568

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Tue Nov 01, 2011 6:51 pm

Re: ASM features EQU and DEFM

boriel wrote:
LCD wrote:Hi Boriel. I just adapted a ASM routine for key-redefining from WOS Forum to ZXBC for my next game, and noticed following:
EQU is not supported?


EQU is supported. It should be used this way (if I recall correctly).

  Code:
Asm
Label EQU 5 * OtherLabel  + 3 ; Complex expressions allowed
End Asm


I had problems with the code from here:
http://www.worldofspectrum.org/forums/s ... tcount=237
  Code:
asm
; ---------------------- CONST -------------------
#line 3
BORDCR:
         EQU 23624
ATTR_P:
         EQU 23693
ROM_CLS:
      EQU 3435
CHAN_OPEN:
      EQU 5633
CC_INK:
         EQU 16
CC_PAPER:
      EQU 17
CC_AT:
         EQU 22
CC_OVER:
         EQU 21
end asm

This rsults in "Unexpected token 'EQU' [EQU]". Maybe a bug?
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
<<

boriel

Site Admin

Posts: 1274

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Nov 01, 2011 8:46 pm

Re: ASM features EQU and DEFM

ZXasm does not support that syntax:
  Code:
LABEL:
   EQU XXXXX
LABEL2:
   EQU YYYYY


Use this instead:
  Code:
LABEL EQU XXXXX
LABEL2 EQU YYYYY
<<

LCD

Posts: 568

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Tue Nov 01, 2011 9:04 pm

Re: ASM features EQU and DEFM

boriel wrote:ZXasm does not support that syntax:
  Code:
LABEL:
   EQU XXXXX
LABEL2:
   EQU YYYYY


Use this instead:
  Code:
LABEL EQU XXXXX
LABEL2 EQU YYYYY

I understand, OK. Big thanks!
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!

Return to Wishlist

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO