CLEAR

Por gdx

Enlighted (5329)

Imagen del gdx

09-10-2021, 10:08

Hello,

Has anyone ever done a CLEAR equivalent in machine language?

Login sesión o register para postear comentarios

Por Metalion

Paragon (1480)

Imagen del Metalion

09-10-2021, 14:08

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

Por gdx

Enlighted (5329)

Imagen del gdx

09-10-2021, 14:30

Yes

Por NYYRIKKI

Enlighted (5917)

Imagen del NYYRIKKI

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.

Por gdx

Enlighted (5329)

Imagen del gdx

11-10-2021, 01:57

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

Por NYYRIKKI

Enlighted (5917)

Imagen del NYYRIKKI

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

Por gdx

Enlighted (5329)

Imagen del gdx

12-10-2021, 09:38

Thanks