Well, since I took away your windows lab machines, here is an alternative. Doing these steps will let you run the assembler from Prof. Voerman on our linux machines under DOS emulation. - Greg

Running Z80 Assembler under DosEmu

Log in on any lab linux box and put the floppy in the drive

  • In a terminal type: /! mount /dev/fd0!/``Enter``
  • Start DOS in a BOX with the command: /! xdosemu !/``Enter``
  • In the DOS window go to the floppy with: /! A: !/``Enter``

Do your work. You can use the DOS edit command to edit your files

  • When done, exit dos by typing: /! exitemu !/``Enter``
  • Unmount the floppy with the command: /! umount /dev/fd0!/``Enter``

For more detail and more options (including how to use emacs to edit your assembler files) read on.

Insert the floppy

open a terminal and type the following command:1)

   user@al83:~$ mount /dev/fd0

You should see the light on the floppy drive flash green.2)

Once the mount command returns a prompt the floppy is mounted.  You can see under linux as /media/floppy0.3)

You have a choice here.4)   If you want a new dos window for dosemu use the command:

  user@al83:~$ xdosemu

otherwise to run it in the same terminal window (if running over an ssh session) use the command:

  user@al83:~$ dosemu

Dosemu may ask you a question or two before it launches, once it does the floppy is “A:” and your home linux home directory is “D:”.

[OPTIONAL] Copy the floppy to your home directory

You can do all the work on the floppy or copy it to your home directory and do the work there.  If you copy it you can work with the assembler when logged in remotely (where you will not have a floppy).  To do this within dosemu, add a sub-directory to your cs325 directory. (You do have a ~/cs325 directory, don't you?) and copy the files there:

  C:\> d:

  D:\> mkdir cs325\z80

  D:\> a:

  A:\> copy *.* d:\cs325\z80\

  HALT.ASM => D:\cs325\z80\HALT.ASM
  HALT.LST => D:\cs325\z80\HALT.LST
  HALT.OBJ => D:\cs325\z80\HALT.OBJ
  HALT.ROM => D:\cs325\z80\HALT.ROM
  .
  .
  .
  A:\> 

[OPTIONAL] Use emacs to edit your code in DOS file format

Linux and DOSemu can both read and write to the floppy and to your home directory. As a result of this you can use emacs or other linux tools and programs to do your work.

In emacs if you create or open a file with an extension of “.asm” you will be put in Assembler mode when editing it but it does not know you intend to use this file under DOS. You need to tell emacs you want it to make a DOS text file.  Do this by pressing ``Ctrl````x````Enter````f`` 5)
emacs will prompt you for the coding you want, type “dos”

  Coding system for visited file (default, nil): dos 

Now you can edit in emacs and compile in dosemu, just remember to save the file before you compile.

[OPTIONAL] Use emacs hexl-mode to view the rom file

If you are curious as to what the rom file looks like you can view it as a hex dump using emacs hexl-mode. Open the file you want to view in emacs. Then press ``Esc````x``, and at the prompt at the bottom of the emacs window enter /!hexl-mode!/``Enter``. In emacs help and tutorials this would writen as /!M-x hexl-mode!/.

Once you are finished working, exit dosemu with the command “exitemu”:

A:\> exitemu

Please remember to unmount the floppy!  You can remove it before you do, but if you forget to give the unmount command it will cause problems for the next person.

user@al80:~$ unmount /dev/fd0

Congratulations! You have just used Linux to emulate DOS and once there you ran a cross compiler so DOS would create code for the Z80! ( Bonus points if you can describe this in terms of signified and signifier.6) )

Hope this helps,

-Greg

 — Greg Priest-Dorman 2008/03/01 21:59


1)
There are GUI tools for mounting and unmounting devices as well. In XFCE4 add the Mount Devices app to one of your pannels and from then on you can click on that to mount and unmount the floppy. In Gnome click the Places → Computer and once that comes up, click on the floppy drive and select mount
2)
If you find a machine with floppy problems write me and tell me. Then (after you write me) take out the floppy and try a different lab machine.
3)
Not convinced, try df -h
4)
xdosemu is also available on your GUI menus. In XFCE4 it is on SYSTEM → DOS emulator. In Gnome it is on Applicaions → Other → DOS emulator
5)
“C-x <Return> f” is the default keybinding for the emacs command “set buffer-file-coding-system” and could of course have also been done with M-x set-buffer-file-coding-system“. But if you know how to change default key bindings it is likly you could have figured that out without me telling you.
6)
http://www.brandonbird.com/signifier_signified.html ok, perhaps not a good example, but I found a way for you to work with the DOS program in Linux, you want me to do your research too?