Pc Assembler
When you want full control
This page was last changed on: November
5th, 1998
Changed on November 5th: WSIO and added FMSIO.
Please the select one of the item you're interested in below:
WHOAMI
- let me introduce myself
README
- read me first!
INSSORT
- sort a table internally
BUBLSORT
- sort a table internally using bubble sort
REPLACE
- replace specific bytes by other bytes
SEARSTRI
- search a string within a memory table (or buffer)
MALLOC
- allocate memory
APPEND
- glue two character fields together
TAPPEND
- test program to show the use of append and/or calling subroutines
READDIR
- reads a directory
READVTOC
- reads the volume table of contents (vtoc) of a disk
DC_DRV
- reads the current drives on your pc and puts them in a table
DC_DIRS
- reads the current libraries of a specified [drive:][path] and puts them
in a table
DC_FILES
- reads the current files of a specified [drive:][path] and puts them in
a table
TO_UPPER
- converts a string to all uppercase characters
MEMSORT
- sorts a passed memory table from a specific position
DIR2ATR
- convert all Atari 8 bits files in a PC directory to an .ATR disk image
XDIRLIST
- retrieve all Atari 8 bit files from .ATR or .XFD disk images and list
them to a file
ATR2XFD
- convert Atari 8 bit .ATR disk images to .XFD disk images
XFD2ATR
- convert Atari 8 bit .XFD disk images to .ATR disk images
XDIR
- browse through Atari 8 bit disk images and/or retrieve Atari 8 bit files
from them
WSIO
- the ultimate screen handler, callable from your Assembly routine
FMSIO
- the ultimate file handler, callable from your Assembly routine
MORE...
- Of course I have more Assembly routines!
Back to HOME page
WHOAMI
Hi,
my name is Bo Schreurs, male, 40 years young, and I program in Pc Assembler
for fun.
I just program in Assembly for 3 years or so. I programmed in Assembly
on other machines
as long as I can remember though. The first Assembler I used was on
an Atari using the
Synapse SynAssembler. One of the best assemblers for the 6502 around
in my humble opinion.
Because an Atari is emulated on the Pc nowadyas, and I have a Pc BBS
there was some
need to program on the Pc. I´ve got Basic,Visual Basic, Visuall
C++, Cobol, Pascal and a lot
of other programming flavors for the Pc, but I wanted to learn another
language on the Pc.
And why not Assembly. Using the "Mastering Turbo Assembler" book from
Tom Swan
I managed to program in Assembly in a relatively very short time.
Nothing spectacular, but enough to do some basic stuff.
On this page you will find some programs I developed just to get an
idea of the
basic operations of Assembly and how to implement general ideas.
If you have comments or problems with the downloaded programs, or if
you want to
point out to me that things can be done easier, drop me an email,
and I will see if I can put your improved version here.
On the other hand, if you have written some nice examples yourself,
and want them to add to my page, email them to me, and I will take
care of it.
You can send your email to: bo
schreurs
Back to TOP of page
README
All programs for the Pc on this page can be downloaded freely.
You may alter them, pass them around, basically do what ever you want
with it.
DISCLAIMER
As far as I know these programs are free of copyright, however if someone
feels his/hers rigths are violated, please contact me, so I can take
precautions.
Although I'm certain no program causes the loss of data in any way,
using the downloaded programs will be at your own risk!
I'm not responsible for any loss or damage to data files, programs
or computer equipment!
Back to TOP of page
INSERT
SORT
An example of sorting a memory table using insertion of table element.
Table, element size and size of the table is all hardcoded, but could
be easily adjusted.
It seems that an Insert Sort is one of the slowest sorting algorithms,
but it works
for small memory tables.
Download this Assembly example
for your PC called INSSORT
NOW!
Back to TOP of page
BUBBLE
SORT
An example of sorting a memory table using bubbling the table elements.
Table, element size and size of the table is all hardcoded, but could
be easily adjusted.
It is said that bubble sorting data elements is faster than an insert
sort.
Quick sorting a table is one of the fastest sorting algorithms.
I don´t have a schematic of this sorting algorithm, so I can´t
post an Assembly example of it.
If you have such schematic of Assembly example please email it to me.
The Buble Sort program which you can download now, works correct.
It seemed that I had posted an incorrect version earlier. Sorry for
that.
Download this Assembly example
for your PC called BUBLSORT
NOW!
Back to TOP of page
REPLACE
CHARACTER
An example of converting a memory table using a conversion table.
Sometimes you want to replace characters within a string or within
a table by other characters.
In fact this is called conversion. This program replace one character
by another characters.
Of course yould program it to replace one character by two other characters,
depending
on your conversion needs. I used this routine to get rid off some undisplayable
ANSI characters
on a non-ANSI system. The message to be converted is loaded in the
memory table,
converted, and written to a new message. Multiple character conversion
can be executed.
Table, element size and size of the table is all hardcoded, but could
be easily adjusted.
Download this Assembly example
for your PC called REPLACE
NOW!
Back to TOP of page
SEARCH
STRING
An example of looking up a string in a memory table (or memory buffer).
Table, search string and size of it all is hardcoded, but could be
easily adjusted.
The program located the first character of the string to be looked
up, and from that
point it compares the string with the string in the memory table, if
it matches up,
we´re finished, if not it scans on. If the string to be searched
for occurs twice or more
in the table, you´ll only get the first string that matches.
Download this Assembly example
for your PC called SEARSTRI
NOW!
Back to TOP of page
ALLOCATE
MEMORY
An example of allocating a piece of memory, resizing it and more.
Of course you can use predefines tables, use the stack or buffers,
but sooner or later you
will write an application that needs to allocate memory space dynamically.
Although I had the manuals and books, I was not able to allocate memory.
Someone on the Internet pointed me out how to do it, and hence this
example.
You can resize or exänd the allocated memory too.
Download this Assembly example
for your PC called MALLOC
NOW!
Back to TOP of page
APPEND TWO
STRINGS
An example of glueing together two strings seperated by one (or two or
no) space.
An algorithm we use a lot on out mini computer is append two strings
together.
Suppose you want to "add" 3 string variables together containg the
following data,
title, initals and surname, i.e. "Mr", "B.F.", and "Schreurs". How
would you program this?
And what if you don´t know the contents of those variables upfront?
And what if there are 4, 5 or 60 variables to "glue" together?
The Append algorith takes care of this.
It moves the first variable to buffer 1, and the second variable to
buffer 2.
It determines the textual line length of the first buffer, add a space
to it (or two or none),
determines the textual line length of the second buffer, and moves
it (or glues it) to the first buffer.
Then it clears the second buffer. A third variable is moved to the
second buffer, and it all starts over.
As soon as all variables have been processed the first buffer contains
the final "appended" string.
This buffer can be moved to an output variable if desired.
I´ve split this algorithm up in two parts. A calleble APPEND
routine, and
a program which call the Append routine.
Download this Assembly example
for your PC called APPEND
NOW!
Download the routine which calls
Append called TAPPEND
NOW!
Back to TOP of page
READ DIRECTORY
A simple example of reading files and directories within the current directory.
No found files are moved to table or whatever, just a plain example.
Compare this with the READVTOC example. See the difference.
Nice thing about this example is that it documents what we´re
retrieving from the directory.
Download this Assembly example
for your PC called READDIR
NOW!
Back to TOP of page
READ V.T.O.C.
An example of reading files and directories from the current directory.
Found files and directories are stored in a memory table which holds
up to 2,000 entries.
Smart programmers can allocate memory on the fly to store the found
files/directories :D
If a directory contains than 2,000 entries, those entries are "skipped".
Download this Assembly example
for your PC called READVTOC
NOW!
Back to TOP of page
DETERMINE
DRIVES
Retrieves all drives from your pc and puts them in a drive table.
The table is 26 bytes in size (drives A thru Z).
Your program will call this subroutine and passes it a drive map.
This subroutine retrieves all drives, places them in the passed drive
map, and returns to your program.
Look at XDIR for an example of the use of it.
Download this Assembly example
for your PC called DC_DRV
NOW!
Back to TOP of page
DETERMINE
DIRECTORIES
Retrieves all directories from your specified path and puts them in a directory
table.
The table can hold up to 200 directories.
They will be sorted in descending order (using MEMSORT).
Your program will call this subroutine and passes it a directory map.
This subroutine retrieves all directories, places them in the passed
directory map, and returns to your program.
Look at XDIRLIST for an example of the use of it.
Download this Assembly example
for your PC called DC_DIRS
NOW!
Back to TOP of page
DETERMINE
FILES
Retrieves all files from your specified path and puts them in a file table.
The table can hold up to 2,000 files.
They will be sorted in ascending order (using MEMSORT).
Your program will call this subroutine and passes it a file map.
This subroutine retrieves all files, places them in the passed file
map, and returns to your program.
Look at XDIRLIST for an example of the use of it.
Download this Assembly example
for your PC called DC_FILES
NOW!
Back to TOP of page
TO
UPPER
Pass a string to this routine, and it will convert all character to uppercase.
When a user enters information on a command line, it can be lowercase.
This program will take of converting such input to uppercase.
Look at XDIRLIST for an example of the use of it.
Download this Assembly example
for your PC called TO_UPPER
NOW!
Back to TOP of page
MEMORY
SORT
This routine will sort any memory table using the buble sort technology.
You can even specify on which starting position of the table entries
should be sorted.
You can also specify if the table should be sorted in ascending or
descending order.
rieves all files from your specified path and puts them in a file table.
Your program will call this subroutine and passes it a memory table
(or memory "file").
This subroutine sorts the table, and returns to your program.
Look at DC_DIRS or DC_FILES for an example of the use
of it.
Download this Assembly example
for your PC called MEMSORT
NOW!
Back to TOP of page
DIRECTORY
TO ATR
Retrieves all files from a specified PC directory and creates an Atari
8 bit disk image file with them.
The files in the PC directory should be Atari 8 bit files.
If all the files will not fit on a single disk image, it will create
several disk images.
This program makes use of the following Assembler routines: DC_FILES
and
MEMSORT
found elsewhere on this page.
Download this Assembly example
for your PC called DIR2ATR
NOW!
Back to TOP of page
XDIRECTORY
LISTER
Scans through a specified directory (or from the root of the drive), and
ALL subdirectories looking for
.ATR and .XFD Atari 8 bit disk images files, retrieves the files from
those disk images, and writes them
out to an output file. The output file is located at C:\LOCATOR.TXT
It shows which directory it is "scanning".
This program makes use of the following Assembler routines: DC_DIRS,
DC_FILES,
TO_UPPER and MEMSORT
found elsewhere on this page.
Download this Assembly example
for your PC called XDIRLIST
NOW!
Back to TOP of page
ATR TO
XFD CONVERTER
This program converts an Atari 8 bit .ATR disk image to an Atari 8 bit
.XFD disk image.
An .ATR disk image contains a 16 byte header.
This program strips of the header, and writes the remaining part of
the disk image to the .XFD disk image.
Download this Assembly example
for your PC called ATR2XFD
NOW!
Back to TOP of page
XFD TO
ATR CONVERTER
This program converts an Atari 8 bit .XFD disk image to an Atari 8 bit
.ATR disk image.
An .ATR disk image contains a 16 byte header.
This program adds this header to the .ATR disk image, and then append
the remaining part of the .XFD disk image to it.
Download this Assembly example
for your PC called XFD2ATR
NOW!
Back to TOP of page
DISK IMAGE
BROWSER
This program lets you browse through all files on your pc using a file
selector box.
It is intended to get a view of the layout of an Atari 8 bit disk image.
Files can be extracted from the disk image, and are written to a specific
directory.
This directory is specified in a XDIR.CFG file located in the root
of the C drive.
This program makes use of the following Assembler routines: DC_DRV
found elsewhere on this page.
Download this Assembly example
for your PC called XDIR
NOW!
Back to TOP of page
SCREEN HANDLER
Ever tried to let your Assembly program do some basic screen I/O?
What? You always work with Command Line parameters to get input from
the user?
That´s because doing screen I/O is not so easy to program? Think
again!!!
Now there is WSIO.
A very powerful subroutine which takes care of doing the screen i/o
for you.
You specify the screen layout (in ASCII), the field types, and where
they should be located,
and let WSIO take care of the rest.
An example wsiotest program is included in the zip file, so you can
see how it works.
Just run the WSIOTEST.EXE file to get an idea of the possibilities
here.
If even informs you if the screen was changed, and even which fields!
Saves you a lot of time checking the data!
NEW! Now it supports a mouse, and some bugs have been removed!
Oh well, try it, and see if it works for you!
Download this Screen Handler
for your PC called WSIO
NOW!
Back to TOP of page
FILE HANDLER
Ever tried to let your Assembly program do some basic file I/O?
You probably noticed that doing file I/O isn't so easy at all, right?
Now there is FMSIO.
A very powerful subroutine which takes care of doing file i/o for you.
You specify the file type (in ASCII), the record size, where the file
resides,
the buffer to use and let FMSIO take care of the rest.
Look at XDIRV10 on the Atari XL/XE page for an example of the usage
of FMSIO.
Oh well, try it, and see if it works for you!
Download this File Handler for
your PC called FMSIO
NOW!
Back to TOP of page
MORE...
Of course I have more Assembly programs and subroutines.
Like a File Selector Box, or a Yes/No Box.
If you´re interested I could email you these programs.
My email address in on my Home Page.
Back to TOP of page