Search found 345 matches

by wimoos
Fri Aug 19, 2022 10:49 am
Forum: Programming
Topic: 2022 version of WimBasic
Replies: 7
Views: 693

2022 version of WimBasic

Hello all, A new version of WimBasic has been released. It is available at http://wimbasic.webs.com A new command has been added: ERASE. This deletes an array that was previously DIM'd. Useful when memory is scarce, an array needs to be reinitialized with zeros or empty strings, or needs to be redim...
by wimoos
Mon Jul 04, 2022 3:25 am
Forum: Programming
Topic: BASIC strings from assembler on Vic
Replies: 7
Views: 511

Re: BASIC strings from assembler on Vic

Below is the ML-code behind he INSTR-function in WimBasic. The function searches a substring in a larger string, with an optional starting position. The result is 0 when not found, non-zero is the location of the substring in the larger string. Regards, wimoos ; ; Perform INSTR ; LA776 JSR $CEFA ; c...
by wimoos
Sat Jun 25, 2022 12:07 pm
Forum: Programming
Topic: Delete a DIM'd array
Replies: 4
Views: 500

Re: Delete one or more DIMmed arrays

I did some minor concessions on the previous version of WimBasic to make space for this new command. The current version now supports the ERASE command. The concessions are that the TOGGLE command is removed and that MERGE no longer prints the text 'MERGING'. ERASE removes a previously dimensioned a...
by wimoos
Thu Jun 02, 2022 7:55 am
Forum: Programming
Topic: Delete a DIM'd array
Replies: 4
Views: 500

Re: Delete one or more DIMmed arrays

PM sent
by wimoos
Wed Jun 01, 2022 6:24 am
Forum: Programming
Topic: Delete a DIM'd array
Replies: 4
Views: 500

Delete a DIM'd array

Hi all, Unfortunately, I couldn't make this part of WimBasic. But the code is fully relocatable, so this opens up possibilities. The tapebuffer is large enough to hold the code. I ran some tests now and it works as expected. Removing an array can be useful when memory is scarce, or when an array nee...
by wimoos
Mon Mar 28, 2022 1:03 pm
Forum: Collecting and History
Topic: ViCalc
Replies: 9
Views: 3089

Re: ViCalc

Fixed it, thanks for your remark. The prg was also included in the zipped autoboot disk in my previous post.
@moderator: Sorry for hijacking this subject.

Regards,

Wim.
by wimoos
Thu Mar 24, 2022 3:49 am
Forum: Programming
Topic: Using a "word" data type
Replies: 19
Views: 951

Re: Using a "word" data type

Not much math needed:

Code: Select all

	PHA
	LDA $EDFD,X
	STA $FD
	LDA $D9,X
	AND #$7F
	STA $FE
	PLA
	STA ($FD),Y ; put char
	LDA $FE
	AND #$03
	ORA #$94
	STA $FE
	LDA $0286
	STA ($FD),Y ; put color
	RTS
by wimoos
Fri Feb 25, 2022 11:20 am
Forum: Collecting and History
Topic: ViCalc
Replies: 9
Views: 3089

Re: ViCalc

I optimised ViCalc in WimBasic. It is now less than 70 lines and a little over 2k in size. I added an autoboot D64 in the zip file. It still works conform the manual I found some bugs that I fixed, and I used WimBasic features like ROUND, EVAL, INSTR, PRINT@ and SWAP. This makes it more responsive. ...
by wimoos
Wed Feb 16, 2022 2:00 am
Forum: Collecting and History
Topic: ViCalc
Replies: 9
Views: 3089

Re: ViCalc

I have looked into ViCalc. Its slowness is more due to the way the screen is handled (cursor movement), than to the length of the program (it is a little bit less than 100 lines). Performance improvements could be done by changing 'IF <cond1> AND <cond2>' into 'IF <cond1> THEN IF <cond2>' constructs...
by wimoos
Fri Jan 28, 2022 2:23 am
Forum: Programming
Topic: Screen values vs PETSCII
Replies: 11
Views: 826

Re: Screen values vs PETSCII

Update: I understand why the mismatches might not matter, though. My test program goes strictly "by the book" (The VIC-20 user manual). If you can't type a character on the keyboard, does it even matter? Maybe, maybe not. For my application, I'd rather convert everything, because I can th...
by wimoos
Thu Jan 27, 2022 5:47 am
Forum: Programming
Topic: Screen values vs PETSCII
Replies: 11
Views: 826

Re: Screen values vs PETSCII

This does the trick:

Code: Select all

	BIT exit
	BEQ ctrlchr
	CMP #$FF
	BEQ ispi
	AND #$BF
	BPL exit
	EOR #$C0
	.BYTE $2C
ispi	LDA #$5E
exit	RTS
by wimoos
Mon Jan 17, 2022 6:27 am
Forum: Programming
Topic: 9-color Block Graphics BASIC Extension for Unexpanded VIC 20
Replies: 9
Views: 941

Re: 9-color Block Graphics BASIC Extension for Unexpanded VIC 20

WimBasic is still at your disposal. Next to SET, RESET and POINT it already supported, I have also added TOGGLE.

For the use of the '9-th color' there is the command AUXCOL to set this color in 36878. The CURSOR command sets the color in 646.

Regards,

Wim.
by wimoos
Mon Dec 20, 2021 10:43 am
Forum: Programming
Topic: DUMP
Replies: 7
Views: 548

Re: DUMP

Hello Jeff, Here is the source for DUMP in WimBasic that you can use as a headstart. Note that DEFined functions are also registered between the regular variables. My routine filters them out. Regards, Wim ; ; Main entry point for DUMP ; LAF29 BNE LAF95 ; LDA $2D LDY $2E LAF2F CPY $30 BNE LAF39 CMP ...
by wimoos
Mon Sep 06, 2021 5:59 am
Forum: Programming
Topic: out of memory
Replies: 9
Views: 603

Re: out of memory

In order to set up a FOR/NEXT loop, a check is done if there is still 18 (decimal) bytes free on stack. For a GOSUB/RETURN a check for 6 bytes is done. Knowing that the stack of the 6502 processor is only 256 bytes, and there is some amount reserved, this gives room for some 40 levels of GOSUBs deep...
by wimoos
Mon Sep 06, 2021 2:14 am
Forum: Programming
Topic: out of memory
Replies: 9
Views: 603

Re: out of memory

FOR/NEXT loops eat stack as well. And a combination of nested FORs and GOSUBs is disastrous. The following example throws an OUT OF MEMORY in no time, leaving unclosed FOR/NEXTs and GOSUBs on the stack. 10 FOR I=1 TO 100 20 GOSUB 100 30 NEXT 40 END 100 FOR I=1 TO 100 110 GOSUB 200 120 NEXT 130 RETUR...