put an "A" on the screen with asm?

Started by funkheld, 12:40, 23 August 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

funkheld


Hi good afternoon.
I would like to put an "A" with asm on the screen, please?


I do not know the address.
------------------------------------
ld hl, &c000    >>>>>? the address
ld (hl), 65
ret
-------------------------------------


thanks
greeting

GeoffB17

Well, you could start with a simpler solution, and use BDOS functions (console commands) and use the Terminal Emulation codes to take care of cursor positioning..   This will take care of a lot of the complications, given that actual screen memory is in Banked RAM and is not immediately accessible, and some of the low level code is also in Banked RAM.   If you want to go a little lower, then you might be able to do something with BIOS calls, which the BDOS would normally call for you, but then you may need to handle the Bank Switching yourself.  The code in the program I sent you bypasses all of this as this is not printing a, 'A' but a graphics image of an enlarged 'A', but clearly this is a LOT more complex.

I would suggest that you start simply.   Have your .asm prog create a string in memory, comprising 4 bytes of the cursor positioning code followed by an 'A', put the address of this $ into (I think) DE, put the BDOS function number for 'Print String' (i.e. 9) into C, and then CALL &H0005.

Geoff


funkheld


thank you.


where is the BDOS listing for this CP / M which is there for the 8256?


greeting

GeoffB17

Hello again,

There's a function list on John Elliott's site, which is also a great source of a lot of info about the PCW, and other Amstrad systems.

Try: https://www.seasip.info/Cpm/bdosfunc.html

On this list, the function ## is also a link to more detail for that function call.   Note that the detail for Function 9 refers to VT32 Terminal, which is the correct type for the PCW, so the code for cursor positioning is correct.   Note about line 4 - so if you need to use line 4 you'll need to change the End-of-String char as referred to.

I'm sure there are other resources as well, just search for BDOS Function List.   Prob something in your own language, which may help?

Although CP/M 3 (Plus) has some differences from the more standard version 2.2, most commands are the same.   Maybe you should look for a book on CP/M programming, but note which commands ARE different between 2.2 and 3.

Look out for the book: Mastering CP/M by Alan R Miller (Sybex 1983) - I've seen copies listed via Amazon.   It's quite old, but very helpful.   Do you have the ASM tools that were on the PCW system disks?  The book, and some other things, are 8080 rather than Z80, note that the book has appendices about both instruction sets and converting between them.

Geoff

funkheld

hello, thanks for help me.


greeting

funkheld

#5
hello, now works in basic as inline data.  :) :) :) 


a simple demo.

I compiled an asm as bin and then read it into data lines.
the first data I have is the length. i wrote the program in purebasic.
it loads the bin and turns it into the data lines from 10000.

"ABCD" is output in Basic when I call.


asm-compiler is pasmo.exe

wonderful. thanks
greeting




org &100
nolist


bdos equ 5


ld a,#41
ld c,2         
ld e,a         
call bdos     
ld a,#42
ld c,2         
ld e,a         
call bdos     
ld a,#43
ld c,2         
ld e,a         
call bdos     
ld a,#44
ld c,2         
ld e,a         
call bdos     
ret



basic:

10 MEMORY &HEFFF
20 plane%=&HF000
30 READ j%
40 FOR i%=0 TO j%-1
50 READ d%
60 POKE plane%+i%,d%
70 NEXT
80 CALL plane%
100 END
10000 DATA 33
10010 DATA 62 ,65 ,14 ,2 ,95 ,205 ,5 ,0 ,62 ,66
10020 DATA 14 ,2 ,95 ,205 ,5 ,0 ,62 ,67 ,14 ,2
10030 DATA 95 ,205 ,5 ,0 ,62 ,68 ,14 ,2 ,95 ,205
10040 DATA 5 ,0 ,201 



Powered by SMFPacks Menu Editor Mod