picocomputer / ehbasic-plus

Experimental Enhanced 6502 BASIC for the Picocomputer
2 stars 1 forks source link

Provide BASIC access to clock() #14

Open netzerohero opened 8 months ago

netzerohero commented 8 months ago

Provide EhBASIC+ access to 100-hz clock() - RIA_OP_CLOCK == 0x0F.

(Requires RIA-release ver >= 0.7)

netzerohero commented 8 months ago

Response options: (a) clock()'s 4-byte response to console; (b) numerical result available to BASIC or (c) string available to BASIC.

(a) 4-bytes of chars simplest to implement, but limited versatility;
(b) numerical result: clock() provides 32-bit clock; EhBASIC floating-pt variables supports 24-bit mantissa. (which still should be OK). (c) string result could rely on existing EhBASIC assembly internals possibly leveraging existing HEX$ keyword function.

Update (a) is coded and working in branch commit f8eb7fe of 28-Feb-2024.

netzerohero commented 5 months ago

Before additional efforts pursued on this on options (b) or (c); work through efforts on learning how to added new commands to EhBasic's token-system (such as adding XPEEK/XPOKE). See (https://github.com/picocomputer/ehbasic-plus/issues/2#issuecomment-2106242311)