Search found 348 matches

by wimoos
Mon Oct 10, 2022 7:22 am
Forum: Programming
Topic: Recursive programming (in WimBasic)
Replies: 5
Views: 964

Recursive programming (in WimBasic)

Hi all, Just for the fun of it: programming recursive functions in CBM Basic cannot be done - it leads to an ?OUT OF MEMORY error. BUT In WimBasic it can be done. For example, calculating a factorial: 10 A$(0)="1" 20 A$(1)="I*FNF(I-1)" 30 DEF FNF(I)=EVAL A$(SGN(I)) 40 PRINT FNF(3...
by wimoos
Mon Aug 22, 2022 12:52 am
Forum: Programming
Topic: 2022 version of WimBasic
Replies: 7
Views: 707

Re: 2022 version of WimBasic

Hey chysn,

It is great to see the fruits of my efforts being used across the world!
Please let me know what you find!

Regards,

Wim.
by wimoos
Sat Aug 20, 2022 11:01 am
Forum: Programming
Topic: 2022 version of WimBasic
Replies: 7
Views: 707

Re: 2022 version of WimBasic

Mike's comment is completely correct, so I would go for that. To answer your question: In WimBasic an EXEC "GOTO"+STR$(A) works as intended should you choose to use a computed GOTO. EXEC "GOSUB"+STR$(A) may run into problems in some scenarios because of the GOSUB stack frame inte...
by wimoos
Fri Aug 19, 2022 10:49 am
Forum: Programming
Topic: 2022 version of WimBasic
Replies: 7
Views: 707

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: 531

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: 506

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: 506

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: 506

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: 3151

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: 978

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: 3151

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: 3151

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: 857

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: 857

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: 960

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.