use of ASM language in

This forum is dedicated to those who want support programming in ugBASIC.
Questo forum è dedicato a chi desidera supporto per programmare in ugBASIC.
Ce forum est dédié à ceux qui souhaitent prendre en charge la programmation en ugBASIC.
Post Reply
ldir_hector
Posts: 12
Joined: Sun Oct 08, 2023 11:47 am

use of ASM language in

Post by ldir_hector »

Hello,
I am trying to make a ugBasic program mixed with z80 assembly for CPC.
Here is the code :

Code: Select all

BITMAP ENABLE(320,200,4)
CLS

trex := LOAD IMAGE("trex.png")

PUT IMAGE trex AT 0,0
PALETTE 20,23,4,28

DIM x AS BYTE
RESTORE ondul
FOR i=1 TO 75
	READ x
	ON CPUZ80 BEGIN ASM

	LD   BC,&BC02
    OUTI
    INC  B
    LD   A,(_x)
    OUT  (C),A             

	END ASM

NEXT
 ONDUL:
            DATA      46,47,47,48,48,48
            DATA      49,49,49,49,48,48,48
            DATA      47,47,46,45,45,44
            DATA      44,44,43,43,43,43
            DATA      44,44,44,45,45
            DATA      46,47,47,48,48,48
            DATA      49,49,49,49,48,48,48
            DATA      47,47,46,45,45,44
            DATA      44,44,43,43,43,43
            DATA      44,44,44,45,45
            DATA      46,47,47,48,48,48
            DATA      49,49,49,49,48,48,48
            DATA      47,47,46,45,45,44
            DATA      44,44,43,43,43,43
            DATA      44,44,44,45,45
But when I compile, I got syntax error, unexpected D, expecting SPAWN.

I used working examples from documentation, and used existing assembly code, I don't know what I am doing wrong ?
ldir_hector
Posts: 12
Joined: Sun Oct 08, 2023 11:47 am

Re: use of ASM language in

Post by ldir_hector »

I understand my mistake, the label ONDUL shall be in lowercase !
Post Reply