08-08-2018, 08:47 PM
Unfortunately it does not work. I wrote this simple program (prova.bas):
but at the moment of compiling it, here is the result:
prova.bas:1: warning: Using default implicit type 'float' for 'myRND'
prova.bas:9: identifier 'myRND' is a var, not a function
prova.bas:9: 'myRND' already declared as a var at 1
To make it work, I must insert the Assembly code into a subroutine:
This will produce the desired effect.
Code:
for n = 1 TO 20
print at 2,0; myRND; ",";
next n
stop
FUNCTION FASTCALL myRND As Byte
Asm
ld a, r
and 0x1F
End Asm
END FUNCTION
but at the moment of compiling it, here is the result:
prova.bas:1: warning: Using default implicit type 'float' for 'myRND'
prova.bas:9: identifier 'myRND' is a var, not a function
prova.bas:9: 'myRND' already declared as a var at 1
To make it work, I must insert the Assembly code into a subroutine:
Code:
10 myRND()
print peek 49152; ",";
pause 0
if code inkey$=13 then goto 10
stop
sub myRND()
Asm
ld a, r
and 0x1F
LD (49152),A
End Asm
end sub
This will produce the desired effect.