CPCWiki forum

General Category => Programming => Topic started by: Fran123 on 12:41, 14 April 23

Title: calling to the program basic from assembler
Post by: Fran123 on 12:41, 14 April 23
Hello

I have a BASIC program in &170 address. I want to invoque it from ASM code. How can I do it?

Thank you.
Title: Re: calling to the program basic from assembler
Post by: pelrun on 13:32, 14 April 23
There's no simple way of doing that. Check out the March 89 issue of Amstrad Computer User for the gory details if you must.

Amstrad Computer User 52 (https://acpc.me/ACME/LITTERATURE_REVUES/%5BENG%5DENGLISH_UK/%5BENG%5D%5BAMSTRAD%5DAMSTRAD_COMPUTER_USER/AMSTRAD_COMPUTER_USER_52%5BOCR%5D.pdf)
Title: Re: calling to the program basic from assembler
Post by: MoteroV4 on 13:34, 14 April 23
From BASIC you had to make a CALL to the ASM code. You just need to come back with a RET.
Title: Re: calling to the program basic from assembler
Post by: Longshot on 16:53, 15 April 23
Hello.
Try with this ... ;)

CALL #B900
SCF
JP #EA7B
Title: Re: calling to the program basic from assembler
Post by: McArti0 on 21:25, 16 April 23
:D pressing buttons on the keyboard

call &bd19 ;wait v-sync
ld a,2
ld (&b8bF),a ;set scan keyboard two interrupt after v-sync
call &bd19 ;wait v-sync

ld a,255-4
ld (&b645),a     ;pressed R

call &bd19 ;wait v-sync
ld (&b644),a     ;pressed U

call &bd19 ;wait v-sync
ld a,255-64
ld (&b644),a     ;pressed N

call &bd19 ;wait v-sync
ld (&b63F),a     ;pressed ENTER

RET ;return to BASIC

possible GOTO 123
Title: Re: calling to the program basic from assembler
Post by: McArti0 on 23:03, 16 April 23
>:( correction
org #4000

call &bd19 ;wait v-sync
ld a,3
ld (&b8bF),a ;set scan keyboard two interrupt after v-sync

call &bd19 ;wait v-sync
halt
ld a,255-4
ld (&b645),a ;pressed R

call &bd19 ;wait v-sync
halt
ld (&b644),a ;pressed U

call &bd19 ;wait v-sync
halt
ld a,255-64
ld (&b644),a ;pressed N

call &bd19 ;wait v-sync
halt
ld (&b63F),a ;pressed ENTER

RET ;return to BASIC

Powered by SMFPacks Menu Editor Mod