Pass value from value basic to asm variable? Pas value from asm to basic variable?

All aspects of programming on the Commander X16.
Post Reply
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Pass value from value basic to asm variable? Pas value from asm to basic variable?

Post by funkheld »

Hi good afternoon.
how can you pass the values please?

Pass value from value basic to asm variable?
Pas value from asm to basic variable?

???
----------------------------
loop:
lda ($02),y
beq done
jsr CHROUT .... no
iny
bne loop
---------------------------

basic:
a= sys $a000 ?
sys $a000 , a ?

greeting


sys $a000 :
-----------------------------
CHROUT = $ffd2
FOUT = $fe06
FMULTT = $fe21
FDIV = $fe24
CONUPK = $fe5a
MOVFM = $fe63

lda #4
sta $01 ; rom bank 4 (BASIC) contains the fp routines.
lda #<flt_two
ldy #>flt_two
jsr MOVFM
lda #<flt_g
ldy #>flt_g
jsr FDIV ; FACC= g/2
lda #<flt_time
ldy #>flt_time
jsr CONUPK ; ARG = time
jsr FMULTT ; FACC = g/2 * time
lda #<flt_time
ldy #>flt_time
jsr CONUPK ; again ARG = time
jsr FMULTT ; FACC = g/2 * time * time
jsr FOUT ; to string
; print string in AY
sta $02
sty $03
ldy #0
loop:
lda ($02),y
beq done
jsr CHROUT
iny
bne loop
done:
rts

flt_g: .byte $84, $1c, $f5, $c2, $8f ; float 9.81
flt_time: .byte $83, $20, $00, $00, $00 ; float 5.0
flt_two: .byte $82, $00, $00, $00, $00 ; float 2.0
---------------------------------------------
Post Reply