Just create a blank command LET with a value.
The machine code will copy the floating-point value to the LET command.
The text value will be ignored by the BASIC monitor.
You can take LET P=1 or P=0="." or other values between 0 to 9...
Only one character to avoid to decay the variable hidden FP value.
Code: Select all
;------- TASM ASM mnemonics. -------
; Compile this file using:
; Set TASMOPTS = -b
; tasm -80 ThisCode.tas MyBinary.BIN
;-----------------------------------
; Zx81 Program name: VB81 XuR [FP.P] :
; REM line name: D=16514/16568 : H=4082/40B8
#define ORG .org ; TASM cross-assembler definitions
#define equ .equ
;------------------------------------
;-BASIC sub-routine entry. -
;+----------------------------------+
; Lb4082 ; <- USR BASIC Enty.
;+----------------------------------+
;------- Rom and Ram Symbols -------
RAM_CH_ADD equ $4016
RAM_SPARE2 equ $407B
DEC_TO_FP equ $14D9
ORG $4082 ; [@16514/@h4082]
Lb4082:
HALT
HALT
LD HL,(RAM_CH_ADD) ; GET CH-ADD
LD (RAM_SPARE2),HL ; SET UNUSED-16
LD HL, Lb40A9
LD (RAM_CH_ADD),HL ; SET CH-ADD
RST 18H
CALL DEC_TO_FP ; []*BIOS ROM*
LD BC,$0006
LD HL,(RAM_SPARE2) ; GET UNUSED-16
ADD HL,BC
EX DE,HL
DEC BC
SBC HL,BC
LDIR
INC BC
LD HL,(RAM_SPARE2) ; GET UNUSED-16
LD (RAM_CH_ADD),HL ; SET CH-ADD
RET ; ==========================
Lb40A9: ; Your value.
.db 3,'.',1,4,1,6,_,_; ZX-TEXT
.db _,_,_,_,_,_,_,_; ZX-TEXT
.end
Code: Select all
# VB81 XuR [FP2LEP.bas]
#
# 1 REM: 92 Bytes@4082-40DD
1 REM [HEX:\
76,76,2A,16,40,22,7B,40,21,A9,40,22,16,40,DF,CD,\
D9,14,01,06,00,2A,7B,40,09,EB,0B,ED,42,ED,B0,03,\
2A,7B,40,22,16,40,C9,1F,1B,1D,20,1D,22,00,00,00,\
00,00,00,00,00,00,00 ]
10 IF USR 16516 THEN LET P=.
20 PRINT P