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 ...
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...
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...
Recently I saw an interesting video about this subject (negative base, fractional power) which made me think again about this forum entry: (-8)^(-2/3) which was calculated to be 1/4. The interesting part of this is that they halved the power and squared the base (leading to a positive base), so: 64^...
Copying N/V from the constant(!) immediate operand would not constitute a bit *test* at all, in the sense there are no 'surprises' to expect in the outcome. Hmm, thinking about this: loading a register with an immediate value DOES set N and Z (many BEQ/BNE or BMI/BPL depend on this). Or, setting(cl...
In the kernal, the following code is used. Why not use that ? ;***********************************************************************************; ; ; calculate pointers to screen lines colour RAM LAB_EA6E JSR LAB_EAB2 ; calculate pointer to current screen line colour RAM LDA LAB_AC ; get next scre...
From screenvalue to PETSCII input in X Y = X AND 63 IF (X AND 32) = 0 THEN Y = Y OR 64 IF (X AND 64) THEN Y = Y OR 128 result in Y (if X>127 then char is reverse) From PETSCII to screenvalue input in X IF (X AND 96) = 0 THEN REM it is a control code X = X AND 191 IF X > 127 THEN X = X AND 127 : X = ...
No duplication tests done, so I wouldn't know about reliability. WimBasic holds the loader. Being 8K in size, it is a pretty heavy solution to load WimBasic from tape first, in order to benefit from fast loading your program. Only if your program is written in WimBasic, then this scenario could be u...