Jump to content
IGNORED

MyBasic 4.05 Docs-Program-Src


9640News

Recommended Posts

2 hours ago, 9640News said:

ve taken a quick look trying to find the source file where this may be defined, but thus far, it is eluding me.  I'm reporting here should anyone want to chase it down and find it before I have additional time to find it. 

Beery, I suggest testing the same program using ABASIC v3.0 and 4.04.  Although I find this unlikely, it sounds as if the TIME$ routine might have been affected by a 4-digit year update.  The OS XOPs do not pass a 4-digit year, however, I seem to recall discussing time/date with Jim long, long ago.  If you don't sort it out by the weekend I'll check my source files and fix notes for any clues.  See next post.

Link to comment
Share on other sites

I searched for TIME$ (Git did a nice job finding it) which led me to 162\STRFUNCT.TXT, a quick glance of the routine seems like the TIME function is tied into the date routine, where Jim extended the year string length.  It looks as if Jim is testing for "99" (the year he added the comment) and adding "20" if it is anything besides 99.  Somehow you'll need to skip this code for the TIME$ function or remove the addition of the "20" altogether.  I don't know what abasic programs were built to rely on the full 4-digit year, if any, and I have no strong opinion as to whether 2- or 4- digit year is better

 

I added a few notes to the code below.  Sorry, the spacing was stripped :(

 

NDATE$ LI R0,X$CDS LOAD OP-CODE
NDA10 LI R1,STRBUF-2 STRINGS ADDRESS
LI R2,254 SIZE OF BUFFER
MOV R2,*R1+ WRITE IT
XOP @NINE,0
 
LI R1,>3939
C @STRBUF+6,R1 added yr to date 04-23-99ju
JEQ XD99 <<<<< ----- if year '99', skip adding '20'. 
MOV @STRBUF+6,@STRBUF+8
LI R1,>3230 <<<<<< ----- this is "20"
MOV R1,@STRBUF+6

JMP XDONE

 

; This time function jumps into the Date function but there is no test to skip "20" and since the seconds field never equals 99, it is always added...

NTIME$ LI R0,X$CTS LOAD OP-CODE
JMP NDA10
  • Like 2
Link to comment
Share on other sites

Thanks Tim.  After my post last night, I went through each file there was and could not find the code.  Thanks for finding the piece of code.  It will be this weekend before I can get into fixing anything with it.

 

Per the Advanced Basic manual, and I am inclined to not change the manual, the DATE$ should report:

 

07/15/21

 

while the TIME$ should report:

 

07:08:00 

 

style format.

 

I will need to make sure fixing one doesn't break the other.  As there are so very few Advanced Basic programs, I think it is very low risk any changes good or bad or with the bug have been impacted.

  • Like 1
Link to comment
Share on other sites

4 hours ago, 9640News said:

I will need to make sure fixing one doesn't break the other.  As there are so very few Advanced Basic programs, I think it is very low risk any changes good or bad or with the bug have been impacted.

Agree.  I think the fix in this section is simple if you change it to conform to the manual; I would just look closely at the XDONE routine and following to verify whether or not the length of the string is dependent on anything.  The snip of code I copied (above) does not seem to account for an increase in length, and the buffer appears to be set to a length of 254, so I would assume the subsequent functions are looking for white space or some other indicator that we aren't seeing.  

Link to comment
Share on other sites

1 hour ago, InsaneMultitasker said:

Agree.  I think the fix in this section is simple if you change it to conform to the manual; I would just look closely at the XDONE routine and following to verify whether or not the length of the string is dependent on anything.  The snip of code I copied (above) does not seem to account for an increase in length, and the buffer appears to be set to a length of 254, so I would assume the subsequent functions are looking for white space or some other indicator that we aren't seeing.  

I'm going to go back and look at the original source file I acquired from Myarc to see how the DATE$ and TIME$ routines were coded since they were intertwined.  I am also going to post a note in another topic to see how the CorComp triple tech card reports date just to make sure there may not be something else I could be overlooking as I doubt very few TripleTech users are following this thread.


Beery

  • Like 1
Link to comment
Share on other sites

8 hours ago, 9640News said:

I'm going to go back and look at the original source file I acquired from Myarc to see how the DATE$ and TIME$ routines were coded since they were intertwined.  I am also going to post a note in another topic to see how the CorComp triple tech card reports date just to make sure there may not be something else I could be overlooking as I doubt very few TripleTech users are following this thread.


Beery

Not currently using it, but do have a triple tech and am following the thread. Let's not assume!!! Lol?

  • Haha 3
Link to comment
Share on other sites

Per a private request, I have uploaded the original V3 Advanced Basic source code to Github at BeeryMiller/Abasic-V3 (github.com)

 

The version 4.07 source code update will be this weekend at BeeryMiller/ABasic: ABasic for MDOS (github.com) and I will post the compiled image here.

 

Beery

 

  • Like 2
  • Thanks 3
Link to comment
Share on other sites

On 7/16/2021 at 10:06 PM, 9640News said:

Per a private request, I have uploaded the original V3 Advanced Basic source code to Github at BeeryMiller/Abasic-V3 (github.com)

 

The version 4.07 source code update will be this weekend at BeeryMiller/ABasic: ABasic for MDOS (github.com) and I will post the compiled image here.

 

Beery

 

 

ABASIC-407.zip

  • Like 4
  • Thanks 2
Link to comment
Share on other sites

  • 3 months later...

OK, quick question.

 

I have not seen anyone do this yet, but has anyone written some assembly source code that calls a simple XOP library call in Advanced Basic on the Geneve?

 

I am trying to initiate a library call to the TIPI XOP library I have written from Advanced Basic. The call returns back to Advanced Basic, but the XOP call looks like it is not being called properly.  Advanced Basic is trying to use as much of the TI-99/4A assembly language page mapping it can, just not sure where it may be stumbling at the moment.

 

I guess it is possible an XOP call may not even be allowed in the program environment.

 

Beery

Link to comment
Share on other sites

2 hours ago, 9640News said:

I have not seen anyone do this yet, but has anyone written some assembly source code that calls a simple XOP library call in Advanced Basic on the Geneve?

Yes, I've used MEM, DSR and KEY XOPs from my BBS assembly running under advanced BASIC. 

 

Set your assembly code workspace to >F000 and make sure your code is relocatable (RORG).  If you plan to use the DSR XOP, transferring data to/from VDP is easy; transferring to CPU RAM requires a bit of smoke and mirrors to get the proper virtual page address.  I think that the CALL LOAD/PEEK instructions write/read to/from the assembly pages, and you have 48K starting at >2000. 

 

I do not know if there are any limitations to calling non-OS XOPs such as Windows or TIPI library code.

 

The following notes may be of help to you, though I never revisited them to fully map out the pages.  So use them as a guide. (Edit: comments for >a000 space are specific to how I use the memory to pass information between BASIC and Assembly on the TI, and I needed to maintain compatibility; C000 space is where I put some of my buffers for IO and screen)

;  MEMORY MAP FOR ABASIC/Assembly:
;      0000-1fff OS/Abasic off-limits
;      2000-2700 XB compatibility, vectors
;      2700-3fff start of our user assembly area
;      4000-5fff open?
;      6000-7fff open?
;      8000-83ff PAD space for compatibility
;      8400-9FFF Uncertain; available?
;      A000-A500 "-24576" area and 1k buffer in 24k high mem for XB compat
;      C000-DFFF using first part of page for buffers; check end of block later
;      E000-FFFF off limits

  • Like 3
Link to comment
Share on other sites

One last thing that comes to mind:  if you do not set the workspace upon entry, I think that Advanced BASIC sets it to GPLWS (83E0) for compatibility.  You can check this in the debugger or by storing the workspace somewhere then checking the value e.g., STWP R10.   For the simple routines, I save R11 and avoid R12-R15, execute my routine, restore R11, then return to advanced basic with "RT".  I don't think you need to clear the status bit and there is no 'gpl' interpreter to branch back to, i.e., do not use B @0x0070.  good luck.

 

 

  • Like 2
Link to comment
Share on other sites

20 minutes ago, 9640News said:

OK, I ran a few tests and have code running, but the TIPI XOP itself is not called the way it should be.  Will take some time to figure out what is happening with the page mapping.


Beery

Do you know for sure that execution is transferred to the TIPI XOP?  Or is the OS XOP handler simply returning without transferring control. 

Link to comment
Share on other sites

9 hours ago, InsaneMultitasker said:

Do you know for sure that execution is transferred to the TIPI XOP?  Or is the OS XOP handler simply returning without transferring control. 

There shouldn't be any reason it is not transferred to the TIPI XOP as it is embedded into MDOS and I use the XOP from within CLI code for the embedded Telnet client.  My suspicion is the memory page my connection string is located on is not being mapped/paged likely as a result of the virtual mapping ABASIC does.  I will need to chase that code down.  I will likely need to test the Video TTYOUT call in some assembly code to see if the string is mapped in and can be displayed or if it too has an issue.  


Beery

Link to comment
Share on other sites

5 hours ago, 9640News said:

There shouldn't be any reason it is not transferred to the TIPI XOP as it is embedded into MDOS and I use the XOP from within CLI code for the embedded Telnet client.  My suspicion is the memory page my connection string is located on is not being mapped/paged likely as a result of the virtual mapping ABASIC does.  I will need to chase that code down.  I will likely need to test the Video TTYOUT call in some assembly code to see if the string is mapped in and can be displayed or if it too has an issue.  


Beery

Good approach.  If Abasic is mapping only some of the assembly space pages at a time, you could encounter what you describe.  It was my understanding that once control was passed to the assembly space, all 48K was mapped in for contiguous access to those pages, and the XOP handler should find those pages.  It will be interesting to see what you uncover and how the Video XOP reacts.

Link to comment
Share on other sites

  • 2 months later...

@9640News - In READLN, see label R900. Change >8000 to >8300. This appears to resolve the problem reported by @hloberg for both command line and run modes.

 

Would it also be possible to update the thread title and/or tags to include "Advanced Basic"? (not sure if you can do that or if it has to be requested?)

 

---=============================================

File:HDS1.161.READLN   Page: 4 Date: 08-01-14  Time: 23:38:48

 

      JNE  R400              NO KEY

R900   CI   R1,>8000          IS IT CONTL C? <<<--- 1.21.2022, change this to >8300 to fix CTRL-C artifact/processing
       JEQ  READ$1            IGNOR IT
       MOVB R1,@RKEY          SAVE IT IN THE STRUCTURE
       BL   @RSTCHR           PUT THE CHARACTER BACK ON SCREEN AFTER KEY PUSH

 

 

 

Link to comment
Share on other sites

I found something else of interest while poking around my files.  This is a support routine that I wrote so that I could use CPU-RAM based file IO buffers from within Advanced BASIC assembly CALL LINK routines. 

 

;..............................................................................
; Advanced BASIC is an MDOS task with its own page map. Our challenge is to
; identify which page is mapped into the desired buffer 8k window after control

; is transferred via a CALL LINK to our routine.  Once we have control, we then
; need to find the task's virtual page number which is NOT the same as the
; mapped local page.  This will give us the proper 24-bit address for the PAB.
; This code must not be located in the c000-dfff range unless the target buffer

; is modified!

;
; Excerpt from S&T BBS source
; Contact: insanemultitasker via atariage
;
;                    zz  yyxx    ;24-bit buffer, virtualpagemap
DPAB1  DATA >0000,>0000,>0000   
REC### DATA >0000,>0000,>0000,>0000        
DPABL1 DATA >0000     ;len
       TEXT '                                          '

FULLMAP BSS 300          space for full pagemap 2mb + extra
BBSMAP  BSS 10           save the assembly map (local)
VIRFLG DATA 0            one time flag (we only need this code once)


; this routine is called before the main DSR routine via BL @SETVIR
; It could be called at program initialization or before each

; DSR request, depending on program requirements.

;
SETVIR ABS  @VIRFLG      Already executed (Flag set)?
       JNE  VIRRT        yes, skip

       LWPI >F000        temporarily use (should be ok for abasic assembly)
       LI   R0,4
       LI   R1,FULLMAP
       LI   R2,255
       XOP  @SEVEN,0     R2 holds the total virtual pages
;
; For this program, we "hardcoded" our PAB buffer within the (>c000-dfff)
; page of assembly space reserved by Advanced BASIC [48k from >2000-dfff]
;

       CLR  R0
       MOVB @>F116,@BBSMAP    Get current page for abasic >c000 ass. space
       LI   R1,FULLMAP        start searching the pagemap for the page
NEXT9A CB   @BBSMAP,*R1+      Did we find the page?
       JEQ  GOTPAGE           yes
       INC  R0           no,
       DEC  R2           any more virtual pages?
       JNE  NEXT9A       in theory should never happen
       JMP  VIRTRR       ERROR; exit dsrlnk completely

;

; We have the offset i.e., the virtual page of our task belonging to
; the assembly page >c000; now we need to manipulate it so that the PAB
; has the virtual page - not the local page - for the buffer
;
GOTPAGE
       SWPB R0           put virtual page# in MSByte
       MOV  R0,R1        make a copy
       SRL  R0,3         drop 3 bits, put remaining 5 into bits 21-17
       MOVB R0,@DPAB1+3
       CLR  @DPAB1+4     clear lower 16 bits
       SLA  R1,5         drop sig 5 bits of virtualpage
       MOVB R1,@DPAB1+4  and put into bits 16-14

;

; in theory, we are now pointing to the virtual page/address for the >C000 page
; starting at page offset >0000.  (range >0000->1fff), or in other words,

; bits 0-13 representing the 8k window space.
; For DSR operations that modify the buffer address, we must cache the page
; and base, and manage accordingly.  (e.g., bread/bwrite)
;

       SETO @VIRFLG      set flag so we don't do this again
VIRRT  LWPI WS    ;return to calling routine
       RT

VIRTRR LWPI WS  ;error in map, bypass calling routine, exit back to interpreter
       RTWP

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...