Jump to content

576XE

Members
  • Posts

    848
  • Joined

  • Last visited

Everything posted by 576XE

  1. 576XE

    CC8

    Hello friends! Here is some routine from documentation to illustrate using of constant expression with asm statement. char ml_routine[] = 0x68, ..., 0x60; /* ML routine */ char * strchr(s, c) char *s; int c; asm ml_routine; I can't initialize array of bytes absolutely this way. What's wrong? Help me, please! I want to write 24-bit calculations for C. zen
  2. Hello there, Ticled Pink! And YES, of course, I have some pretentions to PL65, but ... - You know that Atari filesystem is FRAGMENTED anyway! And this compatibility is essential! - You know that There are no Structs/Records in PL65 - TOO BAD, TOO SAD! But POINTERS are available, thus workarounds! I created some functions to control Linked Lists, voila! The BEST language for Atari is CLSN PASCAL of course, but ... The common PROBLEM is ORDINAL TYPE of LONGINT, i.e. Multiplication in Cycles for ... EVERY calculated BYTE! There are CC65 - TOO SLOW! I think they wanted to make all-platform-language and it was bad idea anyway. Only PL65 Rules!!! Really no problem in placement of memory parts in PL65 because Atari is one-tasc computer. Times ago I thinked that PMG is too memory consumption thing, but I was youngster there. Now I'm trying to find some useful algorythm to move small bites oriented object (like Mouse) on screen. And thank you for your reply. Highly Appreciated! zen
  3. May be this looks slightly better...
  4. Here I added 24 bit calculations (I just needed an access to Bank memory so Add24 and Sub24) It needs TEXT.LIB because "num to text" and "text to num" transformations. INCLUDE TERMINAL.LIB INCLUDE TEXT.LIB != Globals ==========================! BYTE op1[3]=$0600,op2[3]=$0603 STRING li1$[7],li2$[7] !------------------------------------! PROC inpHex(INT li1A,li1L,li2A,li2L) STRING l1$[2],m1$[2],b1$[2] STRING l2$[2],m2$[2],b2$[2] BEGIN l1$=Mid$(li1$,6,2) m1$=Mid$(li1$,4,2) b1$=Mid$(li1$,2,2) l2$=Mid$(li2$,6,2) m2$=Mid$(li2$,4,2) b2$=Mid$(li2$,2,2) BASE=16 op1[0]=VAL(l1$) op1[1]=VAL(m1$) op1[2]=VAL(b1$) op2[0]=VAL(l2$) op2[1]=VAL(m2$) op2[2]=VAL(b2$) BASE=10 END !------------------------------------! PROC outHex() STRING w$[2] BEGIN IF op1[2]>=10 THEN WRITE(op1[2]) ELSE w$[1]=STR$(0) w$[2]=STR$(op1[2]) WRTSTR(w$) ENDIF IF op1[1]>=10 THEN WRITE(op1[1]) ELSE w$[0]=STR$(0) w$[1]=STR$(op1[1]) WRTSTR(w$) ENDIF IF op1[0]>=10 THEN WRITE(op1[0]) ELSE w$[1]=STR$(0) w$[2]=STR$(op1[0]) WRTSTR(w$) ENDIF END !------------------------------------! PROC Add24() POINTER zp1,zp2 BEGIN zp1=.op1 zp2=.op2 STX XSAVE LDX #$03 LDY #$00 CLC :loop LDA (zp1),Y ADC (zp2),Y STA (zp1),Y INY DEX BNE loop LDX XSAVE END !------------------------------------! PROC Sub24() POINTER zp1,zp2 BEGIN zp1=.op1 zp2=.op2 STX XSAVE LDX #$03 LDY #$00 SEC :loop LDA (zp1),Y SBC (zp2),Y STA (zp1),Y INY DEX BNE loop LDX XSAVE END !====================================! MAIN() STRING w$[2] BEGIN li1$="$ABCDEF" li2$="$123456" inpHex(li1$,li2$) BASE=16 Add24() WRTSTR("$") outHex() CR() inpHex(li1$,li2$) BASE=16 Sub24() WRTSTR("$") outHex() CR() END !====================================! Here is the image of disk... PL65 TEXT SpDOSx33a 360.atr And the result of $ABCDEF and $123456 Addition and Subtruction
  5. Some explaination after all... There are 2 forms of string arguments representation in PL65. 1. String Name calling: FE out$=Conc$(a$,b$) - Useful ONLY if we initialize string in THE SAME function !!! 2. String INTs calling: FE out$=Conc$(aAdr,aLen,bAdr,bLen) Here aAdr,aLen,bAdr,bLen obviously declared as INTs in Conc$ - Useful if we initialize string in Calling Procedure and want to send string parameters to Called Subroutine. It's related to the fact that strings are stored on Stack Only in Adr,Len format and Called Function expected just such data but Name. Best wishes from Moscow zen
  6. Sorry!!! BYTE wV BASED sP !Must be INT in Library of course!
  7. Hello Friends! Recently I've wrote PL65 TEXT Librery with some useful functions. You can use it at your service, of course. !====================================! ! TEXT.LIB ! ! Text Functions Library for PL65 ! ! Programming Language ! !------------------------------------! ! Evgeny Zolotarev,(aka 576XE), 2023 ! !====================================! POINTER sP BYTE sV BASED sP BYTE wV BASED sP !====================================! FUNC Left$(INT sA,sL,n) STRING out$[256] INT i BEGIN FOR i=0 TO n DO sP=sA+i out$[i,i]=CHR$(sV) NEXT END out$ !------------------------------------! FUNC Mid$(INT sA,sL,m,n) STRING out$[256] INT i BEGIN sA=sA+m-1 FOR i=0 TO n DO sP=sA+i out$[i,i]=CHR$(sV) NEXT END out$ !------------------------------------! FUNC Right$(INT sA,sL,n) STRING out$[256] INT i BEGIN sA=sA+sL-n FOR i=0 TO n DO sP=sA+i out$[i,i]=CHR$(sV) NEXT END out$ !------------------------------------! FUNC Pos(INT pA,pL,sA,sL) POINTER pP BYTE pV BASED pP INT i,j,psn BYTE f BEGIN IF pL<=sL THEN sL=sL-pL+1 i=0 j=0 ! While Fail ... ! Repeating along the String REPEAT f=$FF ! If Success... ! Indexing along the Pattern FOR j=0 TO pL-1 DO sP=sA+i+j pP=pA+j IF sV<>pV THEN f=0 ENDIF NEXT i=i+1 UNTIL (i=sL OR f<>0) IF f<>0 THEN psn=i ELSE psn=0 ENDIF ELSE psn=0 ENDIF END psn !------------------------------------! FUNC Conc$(INT sA,sL,pA,pL) STRING out$[256] INT i,j BEGIN FOR i=0 TO sL DO sP=sA+i out$[i,i]=CHR$(sV) NEXT FOR j=0 TO pL DO sP=pA+j out$[i+j,i+j]=CHR$(sV) NEXT i=sL out$[i,i]=" " END out$ !------------------------------------! FUNC Ins$(INT pA,pL,sA,sL,m) STRING out$[256],a$[256],b$[256] INT n BEGIN a$=Left$(sA,sL,m) b$=Right$(sA,sL,sL-m-1) n=LEN(a$)+pL+1 a$=Conc$(a$,pA,pL) out$=Conc$(a$,b$) END out$ !------------------------------------! FUNC Del$(INT sA,sL,m,n) STRING a$[256],b$[256],out$[256] INT i BEGIN a$=Left$(sA,sL,m) b$=Right$(sA,sL,sL-m-n) out$=Conc$(a$,b$) i=LEN(a$) out$[i,i]=" " sP=.out-2 wV=sL-n+1 END out$ !------------------------------------! FUNC Inv$(INT sA,sL,m,n) STRING out$[256] INT i BEGIN out$=Mid$(sA,sL,1,sL) FOR i=0 TO n-1 DO sP=.out+m-1+i sV=sV+128 NEXT END out$ !------------------------------------! FUNC Upper$(INT sA,sL,m,n) STRING out$[256] INT i BEGIN out$=Mid$(sA,sL,1,sL) FOR i=0 TO n-1 DO sP=.out+m-1+i IF sV>$60 AND sV<$7B THEN sV=sV-$20 ENDIF NEXT END out$ !------------------------------------! FUNC Lower$(INT sA,sL,m,n) STRING out$[256] INT i BEGIN out$=Mid$(sA,sL,1,sL) FOR i=0 TO n-1 DO sP=.out+m-1+i IF sV>$40 AND sV<$5B THEN sV=sV+$20 ENDIF NEXT END out$ !====================================! ENDFILE Also here is Driver program to check functionality. !====================================! ! TEXT.PRG ! ! Text Functions Program for PL65 ! ! Programming Language ! !------------------------------------! ! Evgeny Zolotarev,(aka 576XE), 2023 ! !====================================! INCLUDE TERMINAL.LIB INCLUDE TEXT.LIB !====================================! MAIN() STRING s$[256],p$[256],a$[256],out$[256] INT psn,m,n BEGIN s$="Moscow Alma-Ata Petersburg Evpatoria Feodosia Simeiz Konakovo" p$="Alma-Ata" a$="Syktyvkar" m=15 n=12 CR() WRTSTR("Left$ - ") WRTLN(Left$(s$,6)) WRTSTR("Mid$ - ") WRTLN(Mid$(s$,8,8)) WRTSTR("Right$ - ") WRTLN(Right$(s$,8)) CR() psn=Pos(p$,s$) WRTSTR("Pos - ") WRITE(psn) CR() CR() WRTSTR("Conc$ - ") WRTLN(Conc$(p$,a$)) out$=Ins$(a$,s$,m) WRTSTR("Ins$ -") WRTLN(out$) out$=Del$(s$,m,n) WRTSTR("Del$ -") WRTLN(out$) m=17 n=10 CR() WRTSTR("Inv$ - ") WRTLN(Inv$(s$,m,n)) WRTSTR("Upper$ - ") WRTLN(Upper$(s$,m,n)) WRTSTR("Lower$ - ") WRTLN(Lower$(s$,m,n)) END !====================================! And the result of course... Here is ATR Image of disk PL65 TEXT SpDOSx33a 360.atr Best Wishes from Moscow zen
  8. Merry Christmas and Season Greetings to Old Good Friends. God Bless You and my Warmest Wishes from Cold Moscow. zen
  9. Hi there, Mark. Glad to here from You. 8 years of investigations, and Voila! Best wishes from Moscow! zen
  10. Hello, Friends! Today I decided the problem with string arguments passing to subroutine. The reason of problem is in the fact that There are two different representation of strings in PL65. Human oriented (str$[40]) for declaring and Compiler oriented (addr,len) for calculations. The fact is that Compiler simply not decipheres Human oriented representation into Compiler oriented thus PROC pos(STRING patn$[40],strg$[40]) is meaningless as subroutine arguments must be in Compiler representation for calculations. And this code is working! INCLUDE TERMINAL.LIB FUNC Pos(INT pA,pL,sA,sL) POINTER pP,sP BYTE pV BASED pP,sV BASED sP INT sC,pC,i,j,psn BYTE f BEGIN IF pL<=sL THEN sL=sL-pL+1 i=0 j=0 ! Repeating along the String REPEAT f=$FF ! Indexing along the Pattern FOR j=0 TO pL-1 DO ! Initialize and Atualize Data sP=sA+i+j sC=sV pP=pA+j pC=pV IF sC<>pC THEN f=0 ENDIF NEXT i=i+1 UNTIL (i=sL-1 OR f<>0) IF f<>0 THEN psn=i ELSE psn=0 ENDIF ELSE psn=0 ENDIF END psn MAIN() STRING s$[256],p$[256] INT psn BEGIN s$="Moscow Petersburg Evpatoria Feodosia Simeiz Konakovo" p$="Petersburg" CR() psn=Pos(p$,s$) WRITE(psn) CR() END zen
  11. Hello Friends! As far as it is concerned passing string arguments to PROC... Here is some kind of WORKAROUND! INCLUDE TERMINAL.LIB PROC print(INT a,l) BEGIN WRTLN(a,l) END MAIN() STRING str$[10] ! Defined as Local INT adr,len BEGIN str$="Moscow" ! Initialized adr=.str len=LEN(str$) CR() print(adr,len) END IMHO it can help. Also I think that Pointers can be passed too for working with Literals. zen
  12. ! T.PRG INCLUDE TERMINAL.LIB STRING s$[255] ! String Declaration PROC print(PROC WRTSTR) BEGIN CR() END MAIN() BEGIN s$="Moscow" ! String Assignment print(s$) END This code works. PROC is just indirect parameters passing. Too strange strings behavior. Seems like something crashes the stack. zen
  13. Hello Friends! Investigating PL65 I made too many mistakes!!! So sorry! Here some string declarations: First - Declared and initialized in compile time! STRING s$[960] DATA "Some String Data"; And another: This MUST be Declared in compile time but can be Initialized in Runtime while running MAIN() STRING s$[960] ... MAIN() BEGIN s$="Some String Data" END The memory structure of PL65 strings is : DIM,SIZ,STRING where: NAME=s$ ADDR of string - can be accessed as .s (without $-sign) SIZ is Runtime Size (INT value) addressed as .s-2 DIM is Declared (INT value) like [960] can be accessed as .s-4 STRING is "Some String Data" and is equal to count between "..." (here 16) Here is my trying to make TEXT.LIB for PL65 to normally work with strings. !====================================! ! TEXT.LIB ! ! String Functions for PL65 ! ! Programming Language ! !------------------------------------! ! Evgeny Zolotarev,(aka 576XE), 2022 ! !====================================! !- Global Strings -------------------! STRING p$[960],s$[960] != String Functions =================! FUNC Find() !- Returns COUNTED but INDEXED ------! POINTER pP,sP BYTE pV BASED pP,sV BASED sP BYTE sC,pC,f INT pL,sL,i,j,pos BEGIN pL=LEN(p$) sL=LEN(s$) IF pL<=sL THEN sL=sL-pL+1 i=0 j=0 ! Repeating along the String REPEAT f=$FF ! Traversing along the Pattern FOR j=0 TO pL-1 DO sP=.s+i+j sC=sV pP=.p+j pC=pV IF sC<>pC THEN f=0 ENDIF NEXT i=i+1 UNTIL (i=sL-1 OR f<>0) IF f<>0 THEN pos=i ELSE pos=0 ENDIF ELSE pos=0 ENDIF END pos !====================================! ENDFILE And code for testing !====================================! ! TEXT.PRG ! ! Using String Functions for PL65 ! ! Programming Language ! !------------------------------------! ! Evgeny Zolotarev,(aka 576XE), 2022 ! !====================================! INCLUDE TERMINAL.LIB INCLUDE TEXT.LIB !- Global Data ----------------------! !====================================! MAIN() INT posn BEGIN !- Strings Assignment ---------------! p$="Petersburg" s$="Moscow Petersburg Evpatoria Feodosia Simeiz Konakovo" posn=Find() CR() WRITE(posn) CR() END !====================================! The purpose of placing STRING p$[960],s$[960] in such a strange place is to make it vizible for Find routine while Initializing from MAIN() program !!! I still have some problems with transfering string parameters in PL65, thus use GLOBALS instead. Best wishes from Moscow! zen
  14. Is it possible to create NTSC/PAL version? The Idea of socketed 130XE Mobo is very impressive! zen
  15. Hello Rybags! Really I want to write a library for PL65 to access to 512Kb of my extended memory and use it as normal heap. 3-bytes arithmetic is not a matter. I just need some suggestions to parse a number like this $124000. (i.e. LSB=$00 MSB=$40 BNK=$12) This is DEMO of PL65 using EXTMEM. !====================================! ! BANKS.PRG ! ! Using 130XE Extended Banks in ! ! PL65 Programming Language ! !------------------------------------! ! Evgeny Zolotarev,(aka 576XE), 2020 ! !====================================! INCLUDE TERMINAL.LIB !- Miscellaneous Procedures: !- Clear Screen Procedure -----------! PROC clrScr() CONST clr=125 BEGIN WRTSTR(CHR$(clr)) END !- Wait for Any Key Pressed ---------! PROC anyKey() CONST none=255 BYTE CH=764 BEGIN WRTSTR("Wait for a Key...") CR() WHILE CH=none DO ENDWHILE CH=none END !- EXTMEM Procedures !- CONSTANTS & VARIABLES: CONST bkMask=%10010001 BYTE bkTag,PORTB=$D301,NMIEN=$D40E INT bkNum !- DUMMY array representing ---------! !- Bank Access Window ---------------! BYTE bkMem[$4000]=$4000 !- Bank Selector Values -------------! !- Atari800WinPlus 576XE ------------! BYTE bkSel[33] DATA $93, $81,$83,$85,$87,$89,$8B,$8D,$8F, $A1,$A3,$A5,$A7,$A9,$AB,$AD,$AF, $C1,$C3,$C5,$C7,$C9,$CB,$CD,$CF, $E1,$E3,$E5,$E7,$E9,$EB,$ED,$EF; ! String VAR to store in all BANKS STRING inp$[4+27] DATA " => User DATA from Bank #00"; ! Set string as VAR for output STRING out$[4+27] DATA " "; !- Place bkSel Tags into PORTB ------! PROC setBk*(BYTE bkTag) BEGIN !- Start Wrapper; STOPs IRQ & NMI ---! SEI LDA #$00 STA NMIEN LDA PORTB AND bkMask OR bkTag STA PORTB !- Stop Wrapper; STARTs IRQ & NMI ---! LDA #$40 STA NMIEN CLI END !- Send bkNum to setBk subroutine ---! PROC setBank(INT bkNum) BEGIN bkTag=bkSel[bkNum] setBk*(bkTag) END !- Writes to Bank -------------------! PROC writBk() BEGIN FOR bkNum=0 TO 32 DO WRTSTR("Writing to BANK #") WRITE(bkNum) CR() IF bkNum<10 THEN inp$[25,25]=STR$(0) inp$[26,26]=STR$(bkNum) ELSE inp$[25]=STR$(bkNum) ENDIF out$=inp$ setBank(bkNum) MOVE(.out,LEN(out$),.bkMem) NEXT END !- Reads from Bank ------------------! PROC readBk() BEGIN FOR bkNum=0 TO 32 DO WRTSTR("Reading BANK #") WRITE(bkNum) CR() setBank(bkNum) MOVE(.bkMem,LEN(out$),.out) WRTSTR(out$) CR() NEXT END !------------------------------------! MAIN() BYTE PORT BEGIN LDA PORTB STA PORT clrScr() anyKey() writBk() anyKey() clrScr() readBk() LDA PORT STA PORTB END ! >>> EOF <<< ! Many thanks. Glad to hear from you zen (It's my initials)
  16. Hello good old friends! CLSN Pascal is very impressive Language. One of it's unique properties is the ability to store and read 24-bit(longint) data while addressing in Atari is 16-bit. They use it for example to gain access to 130XE extended memory in the form $14000. (if program data saved in memory as LSB,MSB,BNK it means 1-st Bank, and address of beginning of Access Window i.e. EXTMEM). I'm very curiously how they implemented 24-bit data and addressing, particularly input from terminal and output to it? How they organized heap etc. etc. etc. And a poorly submitted question - How they did it for 6502? What to read? Where to find? etc. God Bless You! Your suggestions will be very appreciated! zen
  17. Hello, Friends! ... Five years later ... While digging my old paper manuscripts from 'The modems USSR Internet Era' I've found some hardly available Artifacts and Scrolls concerning TopDOS !!!!!!!!! I must explain something. At first - all of them was obtained as an internet mail from good old friend from AtariAge dosens years ago and badly gone with my old provider death (near 1995-2000). So pity! But what an interesting reading! For example I've found that TopDOS Pro's directory can hold 256! files/sector in DD-like(based on DD format) subdirectory !!! Please look at the pictures provided: Moreover I've recorded 2 videos on YouTube about Zero installing TopDOS Pro (In Russian of course. You may don't know Russian but MUST know Atari-8/Altirra/may be IDE+2.0! Thus it's NOT a problem.) You may find it here: https://www.youtube.com/watch?v=-dIHlgSTrDc&t=6870s and here https://www.youtube.com/watch?v=lvqN2j3N63s&t=248s And as a Sweetest Cherry on the cake - Old image of TopDOS Pro (May be even Master Disk!) zen TopDOS Pro 2D (Master).ATR
  18. Hello, Marius It seems to me that I created too bad SIO2IDE structure. May you advise me sample sio2ide config? And is it possible to keep s2i.com fdisk.com and s2s.com in root of SIO2IDE? zen
  19. Hello, drac030 ! I beg you pardon for long-term delay. I just tryed to obtain some suggestions before writing. The SIO2IDE is simple IDE interface. As any SIO device it MUST be clearly declared for Atari before Atari turning on. From the other side, being real IDE device it MUST have some seconds delay for spinning the HD spindle. This delay is HW flashed in device BIOS. (I use SIO2IDE with DOM - very compact designe!) It means that if the power supply for SIO2IDE received from Atari (my case), Atari never see SIO2IDE at a time. Standard loading of SIO2IDE looks like 2 stage process: - 1. Atari load itself not defining SIO2IDE. This time SIO2IDE boots to working state. - 2. Pressing 'Reset' console key (with other console keys if needed) we are defining SIO2IDE as a SIO device for Atari. As I haven't external power supply now to independently prepare SIO2IDE before Atari turning on, I can not use Dropcheck's 'Super SDX' as it boots earlier then Atari and so SIO2IDE stays unavailable even after 'Reset'. May be it's possible to patch 'C: subsystem' somehow to arrange controlable delay by pressing 'Space' to enable SIO2IDE after booting SDX ... . (Simply my DataRecorder is dead.) Best wishes from Moscow. zen
  20. Hello, Friends! Does anyone have success to load any *.SRC into ATMAS4? This <Esc>RD:DEMO<Esc><Esc> stanza doing nothing! May be some other sequence? zen
  21. Hello, friends! Just cannot set up working SIO2IDE 4 (I need this to hear real HD sound) with working SuperSDX(Dropcheck). Please help me zen
  22. Hello, Friends! Now I have two messages: 1. To achive some success with Altirra/IDE+2.0 I just launch Altirra as Administrator and Voila ! It's simple. 2. And this is much more serious !!! PreHistory: - Some truly advanced zoologists here carefully explored specific shapes of a.m. mammals I/O-connectors and particular penetration methods to achive their internals... BUT! Please, look at the picture... - Evidently you can see here that left kiba-dachi mammal very poor protected from front/rear attacks being mightily protected from side-directed attempts. - And look, please, at right participant, particularly on it's teeth, katana-sharped biver tail and it's (tail's I mean) exact position. (I've never see anywhere a sword between own legs!) - This Samurai is Hard as Rock, Cool as Sea, Accurate as Chronometer, Powerful as Tornado, what's more?.. Attack? - No chance! i.e. You are observe here NEW clearwater strategy/tactics method effectively protective against highly skilled and deeply motivated gatecrash-oriented zoologists. zen
  23. Hello, FJC! Thank you for reply. Glad to hear from you! I named this number 'magic' because 'Black Box HD Utilities Disk' uses 65534 instead .?! I know that counted number of Atari address field is 65536, and index to addresses is 0-65535. By the way TopDOS Pro added byte to 'counter of files in directory' and they say that DD based densities can contain 256 files/dir if the modifier /D in format string added !!! zen
  24. Hello Friends! Yesterday I've created normal HD environment (Magic number was standard = 65535). It's a good news! Bad news I don't know how I did it at all !!! I just launch Altirra 4.0 with Administrative privileges. I beleive that it's Win10 jokes with Atari emulators. We all awaiting Win11 orders ... The way took 2 weeks because of different sporadic errors... (No drive, Time out etc.) zen
  25. Hi Stephen. Wombats are used to it. More skunk, less skunk no mean... All around die quickly and painlessly... Where the problem? And when I play on 'Wobbleboard' I hope that their rectangular anus became slightly rounded and more circular... Talking about australian mammals I can say that it's a good habit to find a bottle of beer in your 'pocket' even in the middle of the desert. Just having a 'poket' you are decide a half of problem! Beavers in contrary opens every bottle momentarily whith their teeth. Worlds Harmony! zen
×
×
  • Create New...