Jump to content
Sign in to follow this  
vol

Hello World for the Geneve 9640

Recommended Posts

Are there any simple application program sources for the Geneve?  I have a plan to write an assembly program for MDOS but I don't know how to do this. :( The sources of Hello World or similar programs can help much.  Any other materials which can help for my task can be also very useful.

  • Like 1

Share this post


Link to post
Share on other sites

What sort of program are you looking to write?  I may have a few simpler program sources  that I could post this weekend, depending on what type of programming examples would be of benefit to you.

  • Like 4

Share this post


Link to post
Share on other sites
19 hours ago, InsaneMultitasker said:

What sort of program are you looking to write?  I may have a few simpler program sources  that I could post this weekend, depending on what type of programming examples would be of benefit to you.

I am seeking just a simple example like a program which starts, prints something and ends.

Share this post


Link to post
Share on other sites

I have been able to make Hello World myself. :)

Quote

       DEF  START
START  EQU  $
       LI   R0,>27
       LI   R1,STRING
       CLR  R2
       XOP  @SIX,0
       BLWP @0

SIX    DATA 6
STRING TEXT 'Hello World'
       BYTE >D,>A,0
       END

It works.  However I had to use two stage process.  I got OBJ-file using the XAS99 cross-compiler.  Then I used LINK under MDOS to get an executable file.  Is it possible to get an executable file with XAS99 directly?  XAS99 can produce binary files but I still miss how to put a binary file to a disk image using XDM99. :(

  • Like 2

Share this post


Link to post
Share on other sites
19 minutes ago, vol said:

I have been able to make Hello World myself. :)

It works.  However I had to use two stage process.  I got OBJ-file using the XAS99 cross-compiler.  Then I used LINK under MDOS to get an executable file.  Is it possible to get an executable file with XAS99 directly?  XAS99 can produce binary files but I still miss how to put a binary file to a disk image using XDM99. :(

There would be two requirements.  The first is that your program image loads at starting address >0400.  The second is that the 6-byte header for a Geneve native OS program image file requires/contains a different identifier than its TI program image counterparts ('F' or 'G', see the GenLINK SAVEALL command).  In theory it is possible to set up your own 6-byte header in your source, AORG'd at >03FA, this would have the effect of embedding the proper header ahead of the code for binary output with xas/xdm.  

 

I use the Geneve for my development, along with the GenASM and GenLINK programs.  Maybe @ralphb or someone else more experienced with xdt could offer suggestions here. 

  • Like 3

Share this post


Link to post
Share on other sites
Posted (edited)

I do not believe that xas99 will link to an MDOS binary. MDOS expects different things in the executables header.

 

I was once able to use gcc to produce an MDOS hello world, by creating an EA5 PROGRAM image, AORG'ed to 0x0400. Then editing the binary with a little python script, I stuffed an 'F' or 'G' depending on type of memory desired I to binary offset 0x81. I doubt that was universal. (This offset makes no sense, so I can't read my own python code or something, or for my extremely simple case it accidentally worked and this 'fixup' did nothing.)

 

Once you figure out how to link on the cross development system, creating a DSK image and adding a file is doable with xdm99... 

 

Creates disk program.dsk, and adds program.img as PROGRAM image to disk. More options give me control of names and such.

xdm99.py -X SSSD program.dsk -a program.img 

-X SSSD - create a 90K Single Sided Single Density disk image.

-a - add program.img to disk.

// docs say if you add a -n "NAMEONDISK" you'll get controll of that...

https://endlos99.github.io/xdt99/

 

Edited by jedimatt42
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

I attached source for a program I wrote some time ago that is self-contained and uses a few XOPs.   The debug flag (near the end of the program) appears to be enabled, so the self-check CRC shouldn't hinder your running the program.   One word of caution: this program uses sector IO to read/write from sector-based, floppy-drive devices.  If you wish to disable this, find the XOP calls to "@IO" and hop/skip/jump accordingly.

 

While I don't believe it is required (I believe that the OS program loader sets the workspace to >F000 before executing a loaded program)   it is good practice to set your Workspace [>f000->f05f is safe]. and if desired, turn off interrupts.  If you plan to use the sound generation XOP, you can leave interrupts on or periodically perform a limi 1/limi 0.

 

Unlike the TI, memory is allocated in 8k segments at load time based on the size of your program.  Additional memory can be allocated by calling OS memory routine XOPs.  Using your program as an example, you would be safe to use memory from >0400->1FFF, however, >2000 and beyond is perilous unless you request memory page(s) from the OS.   I sometimes take the lazy route by declaring a large BSS block instead of asking for and managing memory ;)   

 

BBRM-sample-for-vol.asm

  • Like 3

Share this post


Link to post
Share on other sites
On 4/10/2021 at 6:35 PM, InsaneMultitasker said:

I attached source for a program I wrote some time ago that is self-contained and uses a few XOPs.   The debug flag (near the end of the program) appears to be enabled, so the self-check CRC shouldn't hinder your running the program.   One word of caution: this program uses sector IO to read/write from sector-based, floppy-drive devices.  If you wish to disable this, find the XOP calls to "@IO" and hop/skip/jump accordingly.

Thank you very much.  I am very impressed by your TTYOUT routine.  IMHO the TMS9900 provides a way to write the shortest such kind routine.

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, vol said:

Thank you very much.  I am very impressed by your TTYOUT routine.  IMHO the TMS9900 provides a way to write the shortest such kind routine.

Yes, much fun can be had with the 9900/9995 :)    I'm sure I learned how to do that from others and/or from sample [Geneve] code, which is not as abundant as in days past.

 

Using R11, R13, and R14 to reference data and calling workspaces is quite handy.

  • Like 1

Share this post


Link to post
Share on other sites
On 4/16/2021 at 7:41 AM, InsaneMultitasker said:

Yes, much fun can be had with the 9900/9995 :)    I'm sure I learned how to do that from others and/or from sample [Geneve] code, which is not as abundant as in days past.

I have used your BBS.  Thank you very much.  It reminded me my experience in the early 90s when I was an active BBS user.  It is sad that BBS doesn't allow to run a program like telnet or ssh do. ;) 

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...