CLEAR

By gdx

Enlighted (4833)

gdx's picture

09-10-2021, 10:08

Hello,

Has anyone ever done a CLEAR equivalent in machine language?

Login or register to post comments

By Metalion

Paragon (1451)

Metalion's picture

09-10-2021, 14:08

You mean reproducing in asm the features of the CLEAR instruction ?

By gdx

Enlighted (4833)

gdx's picture

09-10-2021, 14:30

Yes

By NYYRIKKI

Enlighted (5889)

NYYRIKKI's picture

10-10-2021, 20:27

CLEAR does quite complicated things with HIMEM, MEMSIZ and STKTOP based on VARTAB and MAXFIL values... As this is all so 100% BASIC oriented I wonder why you can't just do it in BASIC? If you want to hide it from users then just execute the statement on your ML-program... I don't really see any benefit reimplementing it.

By gdx

Enlighted (4833)

gdx's picture

11-10-2021, 01:57

It would be useful to install a driver with only BLOAD"name",R for example.

By NYYRIKKI

Enlighted (5889)

NYYRIKKI's picture

11-10-2021, 16:17

Ok... I guess... but I just mean that how about if you just add something like this to the end of your program:

MAXFIL	EQU #F85F

EXIT_TO_BASIC_WITH_CLEAR:

	LD A,1
	LD (MAXFIL),A
	LD HL,200
	LD (STRING_SIZE),HL
	LD HL,#C000
	LD (ADDRESS),HL
	LD HL,BASIC_PROG
	LD A,(HL)
	JP #4646

BASIC_PROG:	DB #92,#C
STRING_SIZE:	DW 0
		DB #2C,#C
ADDRESS:	DW 0,0,0

By gdx

Enlighted (4833)

gdx's picture

12-10-2021, 09:38

Thanks