Hi all,
I have lost the ROM offset to convert a string "123" (in decimal) to a BC value.
I ever used it, but i can't remember the piece of code...
LD DE, STRINGOFFSET ; first char in the D_File for example.
CALL $ROM
And BC= the pointed value...
In the BASIC VAL"123" function ?
Any ideas to refresh my mind ?
[ASM] Is there any ROM jump to get a decimal value...
[ASM] Is there any ROM jump to get a decimal value...
Last edited by XavSnap on Fri Jun 10, 2022 3:43 am, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [ASM] Is there any ROM jump to get a decimal value...
Thanks Dr Beep !
I found another routine:
I found another routine:
Code: Select all
1 REM [ASM=\
;------- TASM ASM mnemonics. -------|\
; Compile this file using:|\
; Set TASMOPTS = -b|\
; tasm -80 ThisCode.tas MyBinary.BIN|\
;-----------------------------------|\
; Zx81 Program name: VB81 XuR [GetNum.bas] :|\
; REM line name: D=16514/16542 : H=4082/409E|\
|\
#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|\
RAM_D_FILE equ $400C|\
INT_TO_FP equ $1548|\
FP_TO_BC equ $158A|\
|\
|\
ORG $4082 ; [@16514/@h4082]|\
Lb4082:|\
LD DE,(RAM_CH_ADD) ; GET CH-ADD|\
LD (RAM_SPARE2),DE ; SET UNUSED-16|\
LD HL,(RAM_D_FILE) ; GET D-FILE|\
INC HL |\
LD (RAM_CH_ADD),HL ; SET CH-ADD|\
RST 18H |\
CALL INT_TO_FP ; [INT-TO-FP]|\
CALL FP_TO_BC ; [FP-TO-BC]|\
LD HL,(RAM_SPARE2) ; GET UNUSED-16|\
LD (RAM_CH_ADD),HL ; SET CH-ADD|\
RET ; ==========================|\
.end|\
]
10 FOR A=0 TO 3
20 PRINT AT 0,A;CHR$(INT(RND*10)+28)
30 NEXT A
40 LET BC=USR 16514
50 PRINT AT 10,10;"BC=";BC
Code: Select all
1 REM [HEX:\
ED,5B,16,40,ED,53,7B,40,\
2A,0C,40,23,22,16,40,DF,\
CD,48,15,CD,8A,15,2A,7B,\
40,22,16,40,C9 ]
10 FOR A=0 TO 3
20 PRINT AT 0,A;CHR$ (INT (RND*10)+28)
30 NEXT A
40 LET BC=USR 16514
50 PRINT AT 10,10;"BC=";BC
Xavier ...on the Facebook groupe : "Zx81 France"(fr)