CPCWiki forum

General Category => Programming => Topic started by: funkheld on 13:15, 12 November 18

Title: How is basic routine implemented in ASM?
Post by: funkheld on 13:15, 12 November 18

Hi good afternoon.
How is this routine implemented in ASM?
-----------------------------------------
POKE & B7C6, & 40
CALL & BC06, & 40
----------------------------------------


This does not work:
-----------------------------------
ld hl, # b7c6
ld (hl), # 40
Id a, # 40
call # bc06
--------------------------------


  Thank you.
Greeting
Title: Re: How is basic routine implemented in ASM?
Post by: Targhan on 13:21, 12 November 18
I replied to you on the other thread, why did you create a new one? Use DE, not A:

ld hl, # b7c6
ld (hl), # 40
ld de, # 40
call # bc06
Title: Re: How is basic routine implemented in ASM?
Post by: funkheld on 13:37, 12 November 18
Hello thanks for the help.


greeting.
Title: Re: How is basic routine implemented in ASM?
Post by: funkheld on 13:53, 12 November 18
this is on error.
in the picture, bytes also move.

memory &3fff
start by &8000

ld hl,#b7c6
ld (hl),#40
ld de,#40
call #bc06   

thanks.
greeting   
Title: Re: How is basic routine implemented in ASM?
Post by: Targhan on 16:56, 12 November 18
Mmmh, I'm no firmware expert, but you probably want to try to change the screen offset to #4000, is that correct?
According to this page (http://www.cantrell.org.uk/david/tech/cpc/cpc-firmware/), the call is #bc08, not #bc06, exact?
And A must be #40 for #4000.


So...
ld a,#40
call #bc08


Please tell us exactly what you want.
Title: Re: How is basic routine implemented in ASM?
Post by: funkheld on 16:51, 13 November 18

- I would like to switch in asm the screen on # 4000 and with the
   screen # 4000 work (print etc ...,).
- I would like to switch the screen on # C000 in asm and with the
   screen # C000 work (print etc ...,)


Thnaks.
greeting.
Title: Re: How is basic routine implemented in ASM?
Post by: funkheld on 17:19, 13 November 18

- I would like to switch in asm the screen on # 4000 and with the
   screen # 4000 work (print etc ...,).
- I would like to switch the screen on # C000 in asm and with the
   screen # C000 work (print etc ...,)


Thnaks.
greeting.
Title: Re: How is basic routine implemented in ASM?
Post by: andycadley on 19:39, 13 November 18
ld a,&40
call &bc08



That will set the screen base to #4000 and the firmware routines like PRINT etc will write to that screen. It won't clear the screen or anything, so if there is anything in that memory you'll see junk on the screen until you do a CLEAR or MODE - MODE is probably preferable as that will also reset the screen offset (alternately call the firmware routine at &BC05 with HL =0 to reset the offset)
Title: Re: How is basic routine implemented in ASM?
Post by: AMSDOS on 11:08, 14 November 18
@HAL 6128 (http://www.cpcwiki.eu/forum/index.php?action=profile;u=365) made an BASIC example in the Hisoft Pascal 4T  (http://www.cpcwiki.eu/forum/programming/hisoft-pascal-4t/msg51548/#msg51548) thread which animates a Bouncing Ball between screens placed at &4000 and &C000 to reduce flicker, is this what you're interested in? Their example uses OUT to switch screens, however POKE is used to switch screens without displaying it, so then the screen can be cleared and drawing taking place without display and the OUT commands take care of the rest.


Obviously that approach is going to use more memory, so any ASM would have to be below &4000 or &8000 onwards.
Title: Re: How is basic routine implemented in ASM?
Post by: funkheld on 13:31, 14 November 18
hello thanks for the info.


greeting.
Powered by SMFPacks Menu Editor Mod