Search found 345 matches

by wimoos
Tue Mar 12, 2024 9:05 am
Forum: Other Systems
Topic: Hacking old Commodore Calculators.
Replies: 1
Views: 263

Re: Hacking old Commodore Calculators.

This calculator holds the MPS 7561, which is a dedicated processor for calculators...nowhere near a 6502.
by wimoos
Mon Feb 05, 2024 1:50 am
Forum: Programming
Topic: ROM calls and other tricks
Replies: 33
Views: 63121

Re: Handy toggle

Sometimes you want to toggle a memory location between two values. This can be done using EOR. The value to use for EOR can be constructed with eor in the assembler (operator ^ in this example) To elaborate on this, consider the following code snippet that I used in WimBasic: EOR #$82 ; token NEXT ...
by wimoos
Thu Dec 07, 2023 2:24 am
Forum: Programming
Topic: Getting a signed multiply working (was: How do I print signed integer numbers?)
Replies: 6
Views: 2874

Re: Getting a signed multiply working (was: How do I print signed integer numbers?)

This prints signed integers (-32768 to 32767), including the sign character. It uses Zp $60-$66 and $01FF-$0210.

Code: Select all

	LDY <low byte>
	LDA <high byte>
	JSR $D395		; convert to float
	INY			; eqv. LDY #$01
	JMP $DDD7
by wimoos
Fri Oct 20, 2023 5:32 am
Forum: Programming
Topic: File Command Errors
Replies: 31
Views: 6096

Re: File Command Errors

Hello chysn, (I believe) the following code queries the device at #8 for the last status text and prints it. Not quite sure as I don't have the resources at hand to check it. Regards, Wim. LDA #$08 JSR $FFB4 LDA #$6F JSR $FF96 LAE3C JSR $FFA5 JSR $E742 CMP #$0D BNE LAE3C JMP $FFAB
by wimoos
Fri Oct 20, 2023 5:07 am
Forum: Programming
Topic: File Command Errors
Replies: 31
Views: 6096

Re: File Command Errors

Hello chysn, I looked for this when adding the ' autostart' function to WimBasic. First to check for the existence of the file WBSTART by trying to open and when found, load and run it. Any error (checked in $90) leads to the conclusion that file doesn't exist. So, when trying to scratch a file: jus...
by wimoos
Fri Sep 08, 2023 5:56 am
Forum: Games
Topic: APPLE BUG
Replies: 10
Views: 3318

Re: APPLE BUG

applebug.zip
(2.51 KiB) Downloaded 66 times
In this ZIP both files in PRG format. You need a VIC with no memory expansion.
APPLE1 needs to run first and then APPLE2

When run from disk you need to modify APPLE1 so that it loads and runs APPLE2 properly.

Regards,

Wim.
by wimoos
Wed Aug 30, 2023 2:15 am
Forum: Programming
Topic: MINIGRAFIK lineart
Replies: 47
Views: 16778

Re: MINIGRAFIK lineart

In WimBasic I would use DIVMOD to divide by 150 and then check DQ for oddity. So, check the ML behind DIVMOD.
by wimoos
Tue Aug 29, 2023 5:16 am
Forum: Programming
Topic: MINIGRAFIK lineart
Replies: 47
Views: 16778

Re: MINIGRAFIK lineart

Hello Sven If you want yo go ML, then you should consider doing the whole thing in integers and integer calculation. All calculation results will be in the (maybe double) byte range anyway and you wont have the float-to-integer conversions vice versa (which are relatively expensive in terms of CPU)....
by wimoos
Mon Mar 20, 2023 1:59 am
Forum: Programming
Topic: Odd nested FOR loop behaviour
Replies: 4
Views: 392

Re: Odd nested FOR loop behaviour

WimBasic actually has a command to resolve issues like this, i.e. DISPOSE NEXT. This drops the most recent FOR/NEXT frame, or can drop multiple frames when the accompanying variable is specified. 10 FORI=1TO4 20 IFI=3THEN DISPOSE NEXT :GOTO40 30 NEXT 40 FORU=1TO2:FORI=1TO2:PRINTI,U:NEXT:NEXT The DIS...
by wimoos
Mon Mar 13, 2023 5:59 am
Forum: Games
Topic: Minesweeper for Commodore 64 and VIC-20
Replies: 4
Views: 2377

Re: Minesweeper for Commodore 64 and VIC-20

Hi Rich, Great to have a Minesweeper game on the VIC ! Now, I converted it to a WimBasic version. That makes it no longer dependant on the memory configuration. I brought it back to 36 lines, 1682 bytes. Also, I brought down runtime memory consumption. It can now play in a stock VIC-20 with WimBasic...
by wimoos
Fri Oct 28, 2022 4:25 am
Forum: Programming
Topic: Recursive programming (in WimBasic)
Replies: 5
Views: 917

Re: Recursive programming (in WimBasic)

Of course, you never need recursive subroutines, so maybe it's one of those interesting ideas with no good reason to do it. Well, as a famous Dutch philosopher once said: "never say never". Here's the (recursive) code for solving "Tower of Hanoi": 10 n=5:dimlf$(n),la$(n),lt$(n):...
by wimoos
Tue Oct 11, 2022 12:58 am
Forum: Programming
Topic: Recursive programming (in WimBasic)
Replies: 5
Views: 917

Re: Recursive programming (in WimBasic)

Rewriting line 20 as

Code: Select all

20 A$(1)="FNF(I-1)*I"
uses less stack and makes FNF(4) and FNF(5) work as well.

'Crafting' a stack and handling variables 'local' in vanilla CBM Basic can make you go 23 levels deep.

Regards,

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

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

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

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...