Formatting a Disk (help needed)

I do not have an actual disk drive to test this on, I use the emulator of the floppy emulator on my Adam but if you do can you test this:

  1. Boot up CP/M on floppy
  2. Type Format
  3. When prompted put in a blank disk and format it, verify when done
  4. Boot Smart Basic
  5. Depending on your setup type CATALOG,D1 (or D3 or D5) to view the catalog of the smart basic disk
  6. Now remove the Smart Basic disk and insert the CP/M formatted disk
  7. Type INIT HELLO,D1 (or D3 or D5, again varies based on setup)
  8. Now type 10 PRINT “HELLO WORLD”
  9. Save this with SAVE WORLD
  10. Reboot with the Smart Basic disk
  11. Put the disk that was formatted with CP/M in and type LOAD WORLD
  12. Did it work?

Make Your Own 5 Minute Data Pack

This is a very brief post that I will give more information on later:

As part of the first of many new games that I will be selling for the Adam this year I have come up with a way of creating quick data packs to hold these games. My games (and other software) are standalone products and as such do not need a complete 256kb data pack to hold them. So to make it easier I have figured out how to make a data pack in 5 minutes that will hold about 20kb of data. To do this is easy, but before you do you may wish to read this post on making a true data pack as you will be doing the same thing with some minor changes.

What you need:

  • An original super game pack, buck rogers, donkey kong junior,  or the like. It can not be a normal data pack
  • a new blank audio tape – any size is ok
  • a compatible tape deck
  • a copy of file manager

Making a new tape:

To make a 5 minute tape you are going to do what is detailed in the post about making data packs from audio tapes with the exception that you will need a timer. Set the timer for 5 minutes then start recording side A. When the time goes off. stop both decks, flip both tapes and record side B. Then follow the steps in the previous post about making the holes in the new tape.

Putting software on the new tape:

You can use File Manager to copy up to 23 blocks on the new tape you created. The first block is the code that loads when you reset the Adam and needs to be on block 0. The remaining blocks hold code that you would load with a loader routine that is part of the block 0 code. I will detail how this can be done later.

Debug.Asm – Z80 Development Tool

If you are going to be doing any serious z80 programming then you will quickly find a need for this program. It is code that you can include at the end of your z80 source code and then call it with a simple JP CodeDump command. When you do this it will show you the values of all the registers when it was called and let you move around memory starting at the value you put in the source code at CD_CurLoc.  The only caveat is that you need to be in 32 column mode when you enter it. Any other mode will be hard if not impossible to read.


Hello World – Z80 development

(I want to apologize in advance, I am not a fantastic writer)

I like to code in machine language. Using ML you have (almost) complete control over the Adam and can make it do things as fast as it is possible for it to do it.

Writing ML code on the actual Adam for me is hard because I have been been using modern computers for so long I am used to being able to cut and paste, have multiple files, compile fast etc.  So I like to create my code in Windows, compile it and then transfer it to a disk image for testing in the AdamEM emulator and if I want moving it to the real hardware.

Doing so has involved using my editor of choice (ConTEXT), and then using DosBox to emulate a DOS machine and compiling the code using the TeleMark cross-assembler. On a 32 bit machine I could have eliminated DosBox and just used the Command prompt in Windows, but with a 64 bit machine DosBox is required because TeleMark is a 16 bit program.  Once I compiled the program I would then use various methods to get it into an image, mostly WRDISK and sometimes TDOS if I was programming for a CP/M environment but I always felt these were cumbersome so I have been working on a method of creating a disk (or tape) image of the compiled program I am working on and have it just load when I start the emulator (or real hardware). After disassembling the Smart Basic Loader, studying the EOS programmers Guide and banging my head against the wall with disk interleaving I finally was able to create a “simple” process to take my machine language source code, compile it and create a working disk image using just one command.

Hello World

At some point every programmer has made a “Hello World” program. In Smart Basic this is as simple as:

10 PRINT “Hello World”

Writing one in machine language to use under EOS is a little more convoluted to get started as you have to initialize the Video Display Processor to even see anything. Once you get that setup then you can print to the screen.  (Click here to view the source code).

Compiling the Code

To compile the code use the Assemble batch file. If all goes well and there are no errors you will have a usable disk (and tape) image. If you look at the assemble.bat file you will see how it works:

echo off

rem This batch file will assemble the source code file
rem passed on the command line for example: assemble filename
rem where filename is the name of z80 code you wish to
rem assemble and has the extension of .asm. Do not add an
rem extension. The batch file will use filename for the
rem name of the resulting disk and tape images it creates

rem Did they pass a filename to assemble? If not then exit
if "%1"=="" goto NoFileName

rem Do some clean up of old .obj, .lst, .dsk and .ddp files
if exist %1.obj del %1.obj
if exist %1.lst del %1.lst
if exist %1.dsk del %1.dsk
if exist %1.ddp del %1.ddp

rem Now to assemble the file passed TASM will return an error if
rem we could not assemble it and if that happens we will exit

tasm -80 -b %1.asm
if ERRORLEVEL 1 goto AsmError

rem The code assembled ok so now we need to put it in the disk
rem image for use with the emulator and a real Adam. If you are
rem curious how ImageMkr works just run type imagemkr at the prompt

imagemkr %1.obj %1

rem We are all done so lets exit

goto Exit

echo No file name was passed to assemble
goto Exit

echo Error while assembling
if exist %1.obj del %1.obj
if exist %1.lst del %1.lst
goto Exit

rem All done so exit
echo on


Help – resolved

Can you do the following and let me know your results:

  1. Download this zip file
  2. Unzip it and start AdamEm with File Manager as disk 1 and the image called Heather as disk 2
  3. Press F5 to switch to disk 2, F2 for Media Functions and F4 for edit
  4. Press F3 for Block Number and type in a 2 and hit enter.
  5. Press Enter again
  6. Now you are looking at Block 2 Sector 0. On a real Adam press Home and Up arrow until you are looking at Sector 4. In the emulator press the “5” on the keypad and the up Arrow (at same time)
  7. Does it look like the screen shot to the right? All zeros?
  8. If it doesn’t let me know
  9. If it does then  humor me and go to Hex Edit and upload the file called HEATHER.DSK and then scroll down till you get to the section starting with 00000A00
  10. You will see that there is code there, but the same corresponding bytes in the image are zeros. You can verify this by scrolling up a to sector 3 in the image on the emulator and seeing the last of the code that loads

Please let me know your results – either here or on Facebook


Thanks to the information from Eric I was able to determine that I was not taking into account the interleaving of the data on a disk image. The tape images do not use that so it confused me when I started working with disk images. If you are curious how it works here it is where the first number is a 256 byte sector and the second number is the actual sector it should go in. This is using 4kb blocks:

0 -> 0
1 -> 1
2 -> 10
3 -> 11
4 -> 4
5 -> 5
6 -> 14
7 -> 15
8 -> 8
9 -> 9
10 -> 2
11 -> 3
12 -> 12
13 -> 13
14 -> 6
15 -> 7


Replacement Power Supply

If you are looking to dump the printer and use a newer power supply you can use this one from Jameco (RQ-50B). I have made a number of them so far. It is very easy to do if you are willing to sacrifice the power cable from the printer (click here for a video on making your own cable). Just cut the two cables off the printer and then wire them up according to the photo on the left. I use a power strip for the on and off switch.