diff --git a/compack.asm b/compack.asm deleted file mode 100644 index b2d4163..0000000 --- a/compack.asm +++ /dev/null @@ -1,274 +0,0 @@ -; COMpack -; b. Fox - - IDEAL - P386 - MODEL TINY - CODESEG - ORG 100h - include 'fox.mak' -start: -; db 1024 dup(0) ;4 self-packing - -inplen = 24000 -outlen = 27000 - - print hello - mov di, 81h - movzx cx, [di-1] - jcxz usg - mov al, ' ' - repe scasb - je usg - push cx di - dec di - inc cx - mov al, '?' - repne scasb - pop di cx - jne nousg - -usg: print usgtxt - int 20h - -getfil: lea si, [di-1] - mov al, ' ' - repne scasb - jne noout1 - dec di -noout1: mov cx, di - sub cx, si - mov di, offset fname - rep movsb - mov bx, di -srchex: dec bx - cmp [byte bx], '\' - je addext - cmp [byte bx], '.' - je extexs - cmp bx, offset fname - ja srchex -addext: mov ax, 'c.' - stosw - mov ax, 'mo' - stosw -extexs: mov [word di], 0a0dh - mov [byte di+2], '$' - print namtxt - print fname - mov [byte di], 0 -rts: ret - - smartdisk - -nousg: print srctxt - call getfil - push si - - fopen - mov cx, inplen - fread inpbuf - mov dx, offset lontxt - cmp ax, inplen - je panic - push ax - add [filend], ax - fclose - pop cx - - mov dx, offset emptxt - jcxz panic - mov di, offset inpbuf - xor al, al - repe scasb - jne spox -panic: print - int 20h - -spox: dec di - push di - mov [filbgn], di - sub di, offset inpbuf - add [destad], di - add [reljad], di - lda cx - inc ax - call prilen - - pop bx - mov si, offset firflg - mov di, offset outbuf - -pack1: push si di - mov ax, 1 - mov bp, [filend] - lea si, [bx-0ffh] - cmp si, [filbgn] - jnb pack2 - mov si, [filbgn] - cmp si, bx - je packn - -pack2: mov di, bx - mov cx, bp - sub cx, bx - push si - repe cmpsb - pop si - je pack3 - dec di -pack3: mov cx, di - sub cx, bx - cmp cx, ax - jbe pack4 - lda cx - mov dx, si -pack4: inc si - cmp si, bx - jb pack2 - -packn: pop di si - mov bp, ax - sta cx - mov ax, 1 - -putfl1: cmp cx, 2 - rcl [byte si], 1 - jnc putfl2 - mov si, di - stosb -putfl2: loop putfl1 - - cmp bp, ax - mov al, [bx] - je putbyt - mov al, dl - sub al, bl -putbyt: stosb - mov ah, 1 - cmp [si], ah - jne swpflg - mov [si], ax - inc si -swpflg: add bx, bp - cmp bx, [filend] - jb pack1 - - shl [byte si], 1 - jnc corfl1 - mov al, 80h - stosb - jmp corfl3 -corfl1: stc -corfl2: rcl [byte si], 1 - jnc corfl2 -corfl3: rcl [firflg], 1 ;+ - xor al, al - stosb - - sub di, offset depack - mov [filend], di - - print pkdtxt - pop di - mov cx, 81h - add cl, [80h] - sub cx, di - jz nowri - mov al, ' ' - repe scasb - je nowri - mov ax, [filend] - inc ah - cmp ax, [destad] - ja nospac - - call getfil - fcreate - mov cx, [filend] - fwrite depack - fclose - -nowri: mov ax, [filend] - -prilen: mov di, offset lenlst - mov bx, 10 -outnm1: xor dx, dx - div bx - add dl, '0' -outnm2: mov [di], dl - dec di - test ax, ax - jnz outnm1 - mov dl, ' ' - cmp di, offset lennum - jnb outnm2 - print lentxt - ret - -nospac: mov dx, offset zertxt - dos 9 - jmp nowri - -hello db 'COMpack 1.0 by Fox/Taquart',eot -usgtxt db 'This is FREEWARE packer for .COM programs.',eol - db 'Syntax:',eol - db 'COMPACK inpfile [outfile]',eol - db '"inpfile" specifies source path\filename',eol - db '"outfile" specifies target path\filename',eol - db 'The ".COM" extension of filename is default and you don''t have to write it',eol - db 'If you don''t give "outfile" parameter, no file will be saved',eol - db 'and you can only watch the results of packing',eol -zertxt db 'If you want the file saved, you must compile some zero bytes at the beginning',eol - db 'of file to reserve the space for packed data. The code should immediately',eol - db 'follow the zeros.',eot - -srctxt db 'Source file:',eot -pkdtxt db 'Packed file:',eot -namtxt db ' Name: $' -lentxt db 'Length: ' -lennum db ' ' -lenlst db ' bytes',eot -emptxt db 'File is empty!',eot -lontxt db 'File is too long!',eot - smarterr - -filbgn dw inpbuf -filend dw inpbuf - -depack: mov si, offset packed-depack+100h - mov di, 100h -destad = word $-2 - mov al, 1 -firflg = byte $-1 - xor cx, cx -dep1: movsb - dec cx -dep2: inc cx -dep3: add al, al - jnz dep4 - lodsb - adc al, al ;+ -dep4: jnc dep2 - jcxz dep1 - sbb bx, bx ;+ - and bl, [si] - db 0fh,84h ;jz near -reljad dw depack-reljmp -reljmp: inc si - inc cx - push si - lea si, [di+bx] - rep movsb - pop si - jmp dep3 -packed: - -outbuf db outlen dup(?) - -fname: - -inpbuf db inplen dup(?) - - ENDS - END start \ No newline at end of file diff --git a/doc/6502proc.gif b/doc/6502proc.gif deleted file mode 100644 index 2db1ad8..0000000 Binary files a/doc/6502proc.gif and /dev/null differ diff --git a/doc/editors.htm b/doc/editors.htm index 51fbf2e..7b7fb52 100644 --- a/doc/editors.htm +++ b/doc/editors.htm @@ -1,66 +1,105 @@ - - -Configuring editors for X-Assembler - - -

How to configure a text editor for convenient use of X-Assembler

-This document describes, how to setup a text editor to: - -Of course these features are not available in Windows Notepad, so you must -pick another text editor. Fortunately there are many general-purpose text -editors for Windows. I'll fucus on three: - -All of these have similar features. EditPlus is very good, unfortunately it is -shareware (you have to pay $30). The other editors are freeware. Personally -I prefer Code-Genie, which offers unique feature of editing binary files.

-

Highlighting X-Assembler mnemonics

-In the syntax subdirectory you'll find X-Assembler syntax definitions for all -these editors. - -

Single-keystroke assembly

- -

Placing the cursor where an assembly error occured

-This works same for all these three editors: just double-click the line -with the error message. -


Back - - \ No newline at end of file + + + +Configuring editors for xasm + + + +

How to configure a text editor for a convenient use of xasm

+

This document describes, how to setup a text editor to:

+ +

Of course these features are not available in the Windows Notepad, +so you must pick another text editor. Fortunately there are many +general-purpose text editors for Windows. I'll fucus on four of them:

+ +

All of these have similar features. Personally I prefer +Code-Genie.

+

Highlighting xasm mnemonics

+

In the syntax subdirectory you'll find xasm syntax definitions +for all of these editors.

+ +

Single-keystroke assembly

+ +

Placing the cursor where an assembly error occured

+

This works same for all these four editors: just double-click the line +with the error message.

+ + diff --git a/doc/faq.htm b/doc/faq.htm deleted file mode 100644 index fe1473f..0000000 --- a/doc/faq.htm +++ /dev/null @@ -1,30 +0,0 @@ - - -xasm FAQ - - -

Frequently Asked Questions

-What is xasm?
-xasm is a set of a few tools for developing software for 8-bit Atari -computers using a PC computer. It is mainly for people who are familiar -with Quick Assembler, which runs directly on Atari. -

I want to run xasm on my Amiga / Atari ST / Mac / ...
-Unfortunately xasm is written in x86 assembly language, so it is -not portable. -

Why xasm, not X-ASM as in previous versions?
-It's easier to pronounce. ;-) -

Why 'second final edition'?
-Quote from FAQ in version 2.4, regarding 'final edition':
-Because I don't plan adding any new features. xasm is already a very -sophisticated tool, much more powerful than Quick Assembler. -Of course, it does not mean there won't be any new releases. -Very likely there will be bug fixes.
-Comment to 'second':
-I found that new features are quite useful and easy to implement. :-) -

What about supporting other 6502-based machines, other processors (65816 etc.) ?
-xasm is not a universal 6502 cross-assembler. If you need a portable -cross-assembler (and maybe even an excellent C compiler), then visit -www.cc65.org. -


Back - - \ No newline at end of file diff --git a/doc/index.htm b/doc/index.htm deleted file mode 100644 index b8c2193..0000000 --- a/doc/index.htm +++ /dev/null @@ -1,46 +0,0 @@ - - -xasm 2.5.2 second final edition - - -
-
-intel outside - 6502 processor -
-

xasm 2.5.2 second final edition

-Copyright (c) 1998-2002 by Piotr Fusik -
-

-


-

this package contains following utilities (click program name for documentation): -

- - - - - - - - - - - -
NameDescription
X-Assembler6502 cross-assembler
X-BOOTConverts Atari executables to disk images
X-HEADPrints headers of an Atari executable file
X-LOADLoads an executable file to an Atari computer via the SIO2PC interface
-

other documents: -

-

-xasm home page: -http://xasm.atari.org -

-


-

Permission is granted to anyone to use this software and its documentation -for any purpose, including commercial applications, and redistribute it -freely in its original form. The author makes no representations about -the suitability of this software for any purpose. It is provided "as is" -without express or implied warranty. -

- - \ No newline at end of file diff --git a/doc/xasm.htm b/doc/xasm.htm index 3c4142e..cc6c7bd 100644 --- a/doc/xasm.htm +++ b/doc/xasm.htm @@ -1,672 +1,413 @@ -X-Assembler 2.5.2 - -

-

X-Assembler version 2.5.2

-
-

TABLE OF CONTENTS

-
- - -
-


-

INTRODUCTION

-The X-Assembler is a cross-assembler, which generates code for the 6502 processor. -It has been designed to be easy to use for Quick Assembler programmers, -therefore its syntax is an extension of QA's.
-

Changes

-

Version 2.5.2

- -

Version 2.5.1

- -

Version 2.5

-
-

Version 2.4.1

- -

Version 2.4

-
-

Version 2.3

-
-

Version 2.2

-
-

Version 2.0

- -

Version 1.2

- - -
-

USAGE

-

System requirements

- -

Source code requirements

- -

Converting Quick Assembler files

-Because of possible editor-associated problems you had better convert -an Atari text file to a regular PC text file, i.e. EOLs from $9b to $0d/$0a -and ATASCII specific characters to their integer representation.
-You have to change all OPT directives, -but usually you only need to remove them.
-

Assembling a source program

-The common syntax of invoking command line is following:
-
XASM source [options]
-
source is the name of source file. -If no extension is given, the .ASX is implied.

-Default action on invoking without options is to compile -writing to a file with the .OBX extension.

-

Assembling options

-Following options are supported: -
-
/c -
Enable listing false conditionals.
-By default lines skipped due to false condition are not listed.

- -

/d:label=value -
Define a label.
-label should be a valid label name. -value may be any expression (it may use forward references + + + +xasm 2.6.0 + + + +

NAME

+

xasm - 6502 cross-assembler

+

SYNOPSIS

+

xasm source [options]

+

DESCRIPTION

+

xasm is a cross-assembler which generates code for the 6502 +processor.

+

source is the name of the source file. If no filename extension +is given, .ASX is appended. The default action (when invoked without +options) is to assembly source, writing the result to a file with +the .OBX extension.

+

OPTIONS

+
+
/c
+
Enable listing false conditionals. +Lines skipped due to a false condition are not listed by default.
+
/d:label=value
+
Define a label. +label should be a valid label name. +value may be any expression (it may use forward references to labels defined in the source file). -You may use several /d options to define many labels -from the command line.

- -

/e -
Enable setting environment variables pointing to the error location.
-With this option, X-Asm sets two environment variables: -ERRFILE and ERRLINE. -They may be used in a batch file to locate error and set editor's -insertion point on it. For example, you may create following batch file: -
XASM %1 /e
-IF NOT ERRORLEVEL 1 GOTO ok
-NCE +%ERRLINE% %ERRFILE%
-:ok
-
-NCE stands for Norton Classic Editor.

-If there was no error, variables point to the last issued warning. -If no warning occured, they are removed from the environment.

-Note: NCE is an old editor for DOS. To learn about integration with -modern text editors for Windows read this. -

-

/i -
Disable listing included source. Only main source file will be listed.

-

/l[:filename] -
Enable generating listing. -If no filename given, listing is written to source.lst -(where source is the name of the source file (without extension).

- -

/n -
Check source and object file modification time and assemble only -if source is newer than object file. X-Asm does NOT check included -nor inserted files but only main source, so be careful with this option.

-Note: Much more powerful for this purpose is GNU make utility. -In DOS and Windows you may use its DJGPP port (available from -http://www.delorie.com/djgpp).

-

/o:filename -
Specify object file name. Default is source.obx. -You may use the null device (/o:nul) to generate no object file.

- -

/p -
Print fully qualified file names in listing and error messages.
-This option is useful for the Code-Genie editor (see -
here), which can jump to the error location -only if full path is given.

- -

/q -
Suppress info messages.
-Prevents X-Asm from printing "X-Assembler 2.5.2 by Fox/Taquart" -and the summary (how many lines assembled and bytes written). -Good if you are building a project from many source files and don't want -tons of messages.

-

/s -
Disable converting spaces to tabs in listing.
-Using tabs makes listing file shorter. -Tab stops are assumed to be every 8 characters.

-

/t[:filename] -
List label table.
-If no filename given, the table is written at the end of listing -or to source.tab.

- -

/u -
Warn of unused labels.
-A warning message will be issued for each label, which value is never -used.

-

-If source is incorrect, X-Asm stops on first encountered error.

-

Exit codes

-Meaning of exit codes returned by X-Asm:
-3 = bad parameters, assembling not started
-2 = error occured
-1 = warning(s) only
-0 = no errors, no warnings
-

Listing structure

-A line of listing contains: -
    -
  • decimal number of line of source file (if source is different than in -previous listed line, appropriate message line is issued) -
  • hexadecimal origin counter value -
  • hexadecimal values of bytes written to object file
    -Listed are also generated headers. A xxxx-yyyy> in place of origin -counter represents generated header: $xxxx is the first and -$yyyy is the last byte of the block. -A FFFF> represents two $ff bytes written as a header prefix.
    -A plus sign placed after hex numbers stands for more bytes written to object -in this line, not listed through lack of space. -
  • remaining part of listing line is verbatim copy of source line -
-

Label table structure

-A line of label table contains: -
    -
  • some label attributes:
    -n - label defined but not used elsewhere
    -2 - label value known in pass 2 only (label definition uses forward -reference and thus you can't make forward references to that label) -
  • hexadecimal value of the label -
  • name of the label -
- -
-

SYNTAX

- -

Fields

-Source code is line-oriented. Every line of source consists of fields. -Same sequence of characters used in different fields has completely different meaning. -Fields are separated with one or more blank characters. -There can't be any space within a field, except for strings and comments.

-There are following types of fields: -

-Every line of source must match one of two general forms: -
    -
  • LABEL *COMMENT -
  • LABEL :COUNT CMD:CMD OP1 OP2 COMMENT -
-In the first form, both fields are optional. Blank lines are ignored of course. -Comment must here start with one of these characters: ; | or * -(semicolon, pipe or asterisk). Any information in the line following -such character is ignored.

-In the latter form, you must use a minimum of an instruction field. -It depends on the instruction, how many operands it takes. -Every instruction takes constant number of operands, therefore -there's no need to use a special character at the start of a comment, because after -succesfully taking operands, X-Asm discards the remaining part of line. -However, general purpose text editors may highlight -the comments only if a special delimiter is used, and for that reason, -the semicolon is recommended to start a comment.

- -

Label field

-This field is optional. It must start at first character in line, without -any blank characters before. The purpose of using label field is to define a label.
-Label is a symbol representing an integer of range -$ffff..$ffff.
-Name of a label may contain letters, digits and underscores (_). -Digit can not be label's first character. -Name of a label may be as long as you want and all the characters -are meaningful. In Quick Assembler only 6 leading characters were recognized -and some sources may not compile under X-Asm for this reason.
-Defining a label without using EQU makes it equal to current value -of the origin counter.
-Labels can't be redefined.

- -

Repeat count

-Repeating means here assembling single line several times as if -there were several identical lines. Note it is not just duplicating -bytes written to the object file.
-Repeat count, which can be any valid expression, has to be preceded -with a colon.
-Examples: -
:4 asl @
-:2 dta a(*)
-
-In the latter example each DTA has different operand value.
-If repeat count equals zero, remaining part of line is not assembled. -This allows compact single-line conditional assembly. - -

Instruction field

-If this is the first field in a line, the line must start with at least -one blank character. Instruction field consists of one or two instructions. -The latter case is called instructions pairing, because a pair -of instructions have shared operand. You separate instructions -with a colon.
-Example: -
 adc:sta $80
-
is equivalent to -
 adc $80
- sta $80
-
-Note that -
 lda:tax $80
-
is correct, because $80 is a comment for TAX.

-Single instruction always consists of 3 letters. It may be: -

    -
  1. a 6502 command - standard mnemonics are used -
  2. a directive -
  3. a pseudo-command -
- -

Operand field

-Some instructions don't need any operand, -other need two operands.
-6502 commands require operand with proper -
addressing mode.

- -

Comment

-Comment in a statement does not start from any special character -like ; for example. Comment field is implied when appropriate -number of operands was taken.

- -


-

Expressions

-Expressions are numbers combined with operators and brackets. +You may use several /d options to define many labels +from the command line.
+
/e
+
Enable setting environment variables pointing at the error location. +With this option, xasm sets two environment variables: +ERRFILE and ERRLINE. +They may be used in a batch file to locate the error and set editor's +insertion point on it. If there was no error, the variables point at the last +issued warning. If no warning occured, they are removed from +the environment.
+
/i
+
Disable listing included sources. Only main source file will be +listed.
+
/l[:filename]
+
Enable listing. If no filename is given, the listing is written +to source.lst, where source is the name of the source file +(without the extension).
+
/o:filename
+
Specify object file name. The default is source.obx. +You may use the null device (/o:nul) to generate no object file.
+
/p
+
Print fully qualified file names in listing and error messages. +This option is useful for the Code-Genie editor, which can jump to the error +location only if the full path is given.
+
/q
+
Suppress info messages. +Prevents xasm from printing its name and the summary (how many lines +assembled and bytes written). Good if you are building a project from many +source files and don't want tons of messages.
+
/t[:filename]
+
List label table. If no filename given, the table is written +at the end of listing or to source.tab.
+
/u
+
Warn of unused labels. A warning message will be issued for each label, +whose value is never used.
+
+

SYNTAX

+

Source files should be plain ASCII files. Although different line +terminators are supported, CR/LF is recommended because it is the standard +in the DOS/Windows environment. Lines must be no longer than 256 +characters. xasm is not case-sensitive, so you can mix upper- +and lower-case for labels and instructions.

+

xasm is backward compatible with Quick Assembler. +If you want to assembly QA sources with xasm, simply convert the text +file to CR/LF terminators and replace ATASCII specific characters with their +integer representation. You also have to change all OPT directives, +but usually you only need to remove them.

+

A label is a symbol that represents a 32-bit signed integer. +You can define a label by putting its name at the beginning of a line +(with no spaces before). If you do not use the EQU directive, +the label is assigned the current value of the origin counter.

+

Instructions and directives must be preceded with +whitespace. Note that in xasm you can use instruction and directive +names as label names. For example

+
nop
+

defines a label called nop, whereas

+
 nop
+

is a 6502 instruction.

+

Full comment lines must start with a semicolon, a pipe or an asterisk, +with optional label definition and spaces before. Here are examples +of full comment lines:

+
; this is a comment
+ * so it is
+label | and this too
+
+

Lines with instructions (and some directives) +may be repeated. A single line may be assembled several times, +for example:

+
:4 asl @
+table :32*5 dta 5
+
+

In lines with instructions or directives, a comment starts after +the instruction/directive has been successfully parsed. That is, xasm +does not require a special character to start a comment. However, +you still can use one, because it is usually required for correct syntax +highlighting in text editors.

+
 lda foo ; this is a comment
+ sta bar so it is
+ tax #0  tax requires no operand, so #0 starts a comment
+
+

You may put two instructions on the same line. +In this case they have the same operand. For example:

+
 eor:sta foo
+
+

is equivalent to

+
 eor foo
+ sta foo
+
+

Note that

+
 lda:tax #0
+

is allowed (#0 is a comment for tax).

+

EXPRESSIONS

+

Expressions are numbers combined with operators and brackets. You should use square brackets, because parentheses are reserved -for 6502 indirect addressing. - -

Numbers

-Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff. -A number may be:

- - - - - - - -
  • a decimal number
-12345
  • a hexadecimal number
$abcd
  • a binary number
%10100101
  • an ASCII character
'a' or "a"
  • the origin counter value
*
  • a hardware register
^4e
-

-An abbreviation of Atari hardware register is provided to save you trouble of typing -two extra characters (^4e vs $d40e) and to support porting software -between Atari 8-bit computers and Atari 5200 console. These are very similar machines, -one of biggest differences is different location of hardware registers.

- - - - - - - - - - -
Syntax Chip Value in Atari 8-bit
computer mode (OPT G-
Value in Atari 5200
game console mode (OPT G+
^0xGTIA $d00x$c00x
^1xGTIA $d01x$c01x
^2xPOKEY $d20x$e80x
^3xPIA $d30xerror (there's no PIA chip)
^4xANTIC $d40x$d40x
-(x is a hexadecimal digit). -

-
- - -
  • an op-code
{lda #0}
-
-Single-byte op-code of the instruction inside braces (e.g. value of {nop} is $ea). -Operand is discarded and is necessary only for identifying addressing mode. -Instruction should begin just after the left brace and the right brace should -immediately follow the operand or the command.
-
You can skip the operand, if the addressing mode is fixed. -Examples:
-{lda #}, {jsr}, {bne}, {jmp ()}, -{sta a:,x}. -
-

- -

Operators

-Binary operators:

- - - - - - - - - - - - - - - - - - - - - -
+ Addition
- Subtraction
* Multiplication
/ Division
% Remainder
& Bitwise and
| Bitwise or
^ Bitwise xor
<< Arithmetic shift left
>> Arithmetic shift right
= Equal
== Equal (same as =)
<> Not equal
!= Not equal (same as <>)
< Less than
> Greater than
<= Less or equal
>= Greater or equal
&& Logical and
|| Logical or

- -Unary operators:

- - - - - - - -
+Plus (does nothing)
-Minus (changes sign)
~Bitwise not (complements all bits)
!Logical not (changes true to false and vice versa)
<Low (extracts low byte)
>High (extracts high byte)

-Operator precedence:

- - - - - - - - - -
first[](brackets)
+ - ~ < >(unary)
* / % & << >>(binary)
+ - | ^(binary)
= == <> != < > <= >=(binary)
!(unary)
&&(binary)
last ||(binary)

-Note that although the operators are similar to these used in C, C++ and Java, -their priorities are different than in these languages.

-Compare and logical operators assume that zero is false and a non-zero is true. -They return 1 for true.

-While calculating expression, signed 32-bit arithmetic is used. When range of 32 bits -is exceeded, 'Arithmetic overflow' error is generated.

- -


-

Directives

-
-
EQU - assign a value of an expression to the label -
Note that label represents a number, not a text macro.
+for the indirect addressing.

+

Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff. +A number may be:

+
+

Abbreviations of Atari hardware registers are provided to save you +the trouble of typing two extra characters (^4e vs $d40e) +and to ease porting software between Atari 8-bit computers and the Atari 5200 +console. These are very similar machines, one of the biggest differences is +different location of hardware registers.

+ + + + + + + + + + + + + + + +
SyntaxChipValue in the Atari 8-bit
computer mode (opt g-)
Value in the Atari 5200
game console mode (opt g+)
^0xGTIA$D00x$C00x
^1xGTIA$D01x$C01x
^2xPOKEY$D20x$E80x
^3xPIA$D30xerror (there's no PIA chip)
^4xANTIC$D40x$D40x
+

An op-code is the single-byte op-code of the instruction inside braces. +The operand of the instruction is discarded and is necessary only for +identifying the addressing mode. The instruction should begin just after +the left brace and the right brace should immediately follow the operand +or the instruction. +You can skip the operand if the addressing mode +is fixed. Examples: +{lda #}, {jsr}, {bne}, {jmp ()}, +{sta a:,x}.

+

You can use the line repeat counter (#) in the repeated lines. +It counts the iterations starting from zero. Examples:

+
:3 dta # ; generates three bytes: 00, 01, 02.
+line_lo :192 dta l(screen+40*#)
+line_hi :192 dta h(screen+40*#)
+dl :59 dta $4f,a(screen+40*#),0,$4f,a(screen+40*#),0
+
+

The follownig binary operators are supported:

+
    +
  • Addition
  • +
  • Subtraction
  • +
  • Multiplication
  • +
  • Division
  • +
  • Remainder
  • +
  • Bitwise AND
  • +
  • Bitwise OR
  • +
  • Bitwise XOR
  • +
  • << Arithmetic shift left
  • +
  • >> Arithmetic shift right
  • +
  • Equal
  • +
  • == Equal (same as =)
  • +
  • <> Not equal
  • +
  • != Not equal (same as <>)
  • +
  • Less than
  • +
  • Greater than
  • +
  • <= Less or equal
  • +
  • >= Greater or equal
  • +
  • && Logical AND
  • +
  • || Logical OR
  • +
+

The following unary operators are supported:

+
    +
  • Plus (does nothing)
  • +
  • Minus (changes the sign)
  • +
  • Bitwise NOT (complements all bits)
  • +
  • Logical NOT (changes true to false and vice versa)
  • +
  • Low (extracts the low byte)
  • +
  • High (extracts the high byte)
  • +
+

The operator precedence is following:

+ + + + + + + + + + + + + + + + + +
first[](brackets)
+ - ~ < >(unary)
* / % & << >>(binary)
+ - | ^(binary)
= == <> != < > <= >=(binary)
!(unary)
&&(binary)
last ||(binary)
+

Note that although the operators are similar to those used in C, C++ +and Java, their priorities are different than in these languages.

+

Compare and logical operators assume that zero is false and a non-zero +is true. They return 1 for true.

+

While calculating an expression, signed 32-bit arithmetic is used. +When range of 32 bits is exceeded, the 'Arithmetic overflow' error +is generated.

+

DIRECTIVES

+
+
EQU - assign a value of an expression to the label
+
Note that a label represents a number, not a text macro.
Examples: -
five equ 5
+
five equ 5
 here equ *
-
- -
-
OPT - set assembly options -
Five options are available: - -You can turn any of these on or off.
-Default (if no OPT specified) is opt f-g-h+l+o+.
+
+
OPT - set assembly options
+
Five options are available: +
    +
  • F - fill the space between ORGs +with $FF bytes
  • +
  • G - Atari 5200 mode for hardware register abbreviations
  • +
  • H - generate Atari executable headers
  • +
  • L - generate listing
  • +
  • O - generate object file
  • +
+You can turn any of these on or off.
+The default (if no OPT specified) is opt f-g-h+l+o+.
Examples: -
 opt l-      listing off
- opt l+o-    listing on, object file off
- opt f+g+h-  useful for Atari 5200 cartridges - raw output format, 5200 hw regs
-
- -
-
ORG - change value of the origin counter -
- -You can set some options applied to the new header (if headers are +
 opt l-     listing off
+ opt l+o-   listing on, object file off
+ opt f+g+h- useful for Atari 5200 cartridges - raw output format, 5200 hw regs
+
+
ORG - change value of the origin counter
+
You can set some options applied to the new header (if headers are enabled): -
    -
  • a: tells X-Asm to always make a header, even it is unnecessary, -like in ORG *. -
  • f: works same as a:, but additionally tells to generate -a $ff,$ff prefix before the header. X-Asm adds it at the beginning of the file -by default, so use this option only if you want the $ff's somewhere inside.
    -
+
    +
  • a: tells xasm to always make a header, even it is +unnecessary, like in ORG *.
  • +
  • f: works same as a:, but additionally tells to generate +a $FF,$FF prefix before the header. xasm adds it +at the beginning of the file by default, so use this option only if you want +the $FF's somewhere inside.
  • +
Examples: -
 org $600
+
 org $600
  org f:$700
 table org *+100
-
-In the latter example table points to 100 bytes -of uninitialized data (label is assigned to * -before ORG directive is executed).

+

+In the latter example table points to 100 bytes +of uninitialized data (label is assigned to * +before the ORG directive is executed). +

Starting with version 2.6.0, xasm supports code +that is relocated in the memory at runtime. Let's say you want your code +to be run at the zero page. Typically you can't load it directly into this +place, so you load it at a different address and then move at the runtime. +xasm differentiates between the address that it used +for code generation from the address that is used for generating +Atari executable headers. org r: affects only the former one. +Example:

+
 org $8000
+ ldx #code_length-1
+ mva:rpl code_loaded,x z:code_zpage,x-
+ jmp code_zpage
 
-
-
DTA - define data -
There are various data types: -
    -
  • integers -
      -
    • bytes: b(200) or simply 200 -
    • words: a(10000) -
    • low bytes of words: l(511) defines byte 255 -
    • high bytes of words: h(511) defines byte 1 -
    +code_loaded + org r:$30 +code_zpage + jmp * ; ... or something more sensible +code_length equ *-code_zpage +
+

Note that both * and label definitions use the counter used +for code generation. There is no direct access to the other counter, +because I think this is not useful. If you really need it, you can +always type something like:

+
where_am_i equ *-code_zpage+code_loaded
+
+
DTA - define data
+
There are various data types: +
    +
  • integers +
      +
    • bytes: b(200) or simply 200
    • +
    • words: a(10000)
    • +
    • low bytes of words: l(511) defines byte 255
    • +
    • high bytes of words: h(511) defines byte 1
    • +
    You may enter many expressions in parentheses and combine different types -of data in single line, separating things with commas.
    -You may also define a sine lookup table. Syntax is:
    -sin(centre,amp,size,first,last)
    +of data in a single line, separating things with commas.
    +You may also define a sine lookup table. The syntax is:
    +sin(center,amp,size,first,last)
    where: -
      -
    • centre is a number which is added to every sine value -
    • amp is the sine amplitude -
    • size is the sine period -
    • first,last define range of values in the table. -They are optional. Default are 0,size-1. -
    -Example: dta a(sin(0,1000,256,0,63)) defines table of 64 words -representing a quarter of sine with amplitude of 1000.

    -

  • real numbers: r(-1.23456e12)
    -Real numbers are written in 6-byte Atari Floating-Point format. You can't -combine reals with operators, as you can integers.

    -

  • text strings -
      -
    • ASCII strings: c'Text' or c"Text" -
    • ANTIC strings: d'Text' or d"Text" -
    +
      +
    • center is a number which is added to every sine value
    • +
    • amp is the sine amplitude
    • +
    • size is the sine period
    • +
    • first,last define range of values in the table. +They are optional. The default are 0,size-1.
    • +
    +Example: dta a(sin(0,1000,256,0,63)) defines a table of 64 words +representing a quarter of sine with the amplitude of 1000.
  • +
  • real numbers: r(-1.23456e12)
    +Real numbers are written in the 6-byte Atari Floating-Point format.
  • +
  • text strings +
      +
    • ASCII strings: c'Text' or c"Text"
    • +
    • ANTIC strings: d'Text' or d"Text"
    • +
    A character string consists of any of characters surrounded by quotation marks. Within a string, a single quotation mark character is -represented by two succesive quotation marks.
    -Placing a * character after a string inverts -high bit in every byte of string.

    -

-Examples of DTA: -
+represented by two succesive quotation marks.
+Placing a * character after a string inverts +the highest bit in every byte of the string. + +Examples of DTA: +
  dta b(1,2),3,a(1000,-1),l(12345,sin(0,127,256))
  dta d"ANTIC"*,c'It''s a string',$9b
-
- -
ICL - include another source file -
Specifies another file to be included in the assembly as if the contents of -the referenced file appeared in place of the ICL statement. -The included file may contain other ICL statements. -The .ASX extension is added if none given.

+

+
ICL - include another source file
+
Specifies another file to be included in the assembly as if the contents +of the referenced file appeared in place of the ICL statement. +The included file may contain other ICL statements. +The .ASX extension is added if none given.
Examples: -
+
  icl 'macros.asx'
  icl 'c:\atari\xasm\fileio'
-
- -
END - end assembling file -
Remaining part of the file is not assembled. If this statement does -not occur, assembler stops assembling when encounters end of file.
+
+
END - end assembling file
+
Remaining part of the file is not assembled. If this statement does +not occur, the assembler stops assembling when it encounters the end +of the file.
Example: -
+
  end
-
- -
INS - insert contents of file -
Copies every byte of specified file into the object file and updates -the origin counter, as if these bytes were defined with DTA.
-You may specify range of inserted file. Syntax is following: -
+
+
INS - insert contents of file
+
Copies every byte of the specified file into the object file and updates +the origin counter, as if these bytes were defined with DTA.
+You may specify a range of the inserted file. The syntax is following: +
  ins 'file'[,offset[,length]]
-
-First byte in file has offset 0.
-If offset is negative, it is counted from the end of file.
+
+The first byte in a file has the offset of zero.
+If the offset is negative, it is counted from the end of the file.
Examples: -
+
  ins 'picture.raw'
- ins 'file',-256   insert last 256 bytes of file
- ins 'file',10,10  insert bytes 10..19 of file
-
- -
RUN - generate run address -
The Atari executable program should have a run address specified. -A program may be loaded in many areas of memory and started from any address. -
 run addr
-
+ ins 'file',-256 insert last 256 bytes of file + ins 'file',10,10 insert bytes 10..19 of file +
+
RUN - generate run address
+
An Atari executable program should specify a run address. +A program may be loaded in many areas of the memory and started from any +address. +
 run addr
+
is equivalent to: -
 org $2e0
+
 org $2e0
  dta a(addr)
-
-Examples: -
 run start
- run main
-
- -
INI - generate init address -
The Atari executable program may have some routines which are executed -during loading process. There may be many init blocks in one file.
-Examples: -
 ini init
- ini showpic
-
- -
ERT - generate error if expression is true -
Examples: -
 ert *>$c000
- ert len1>$ff||len2>$ff
-
- -
-
IFT - assemble if expression is true
-ELI - else if
-ELS - else
-EIF - end if
-
With these directives you can construct fragments which -are assembled when a condition is met. -Conditional constructions can be nested.
+
Example: -
noscr equ 1
+
 run main
+
+
INI - generate init address
+
An Atari executable program may have some routines which are executed +during the loading process. There may be many init blocks in one file.
+Example: +
 ini showpic
+
+
ERT - generate an error if an expression is true
+
Examples: +
 ert *>$c000
+ ert len1>$ff||len2>$ff
+
+
IFT - assemble if expression is +true
+ELI - else if
+ELS - else
+EIF - end if
+
With these directives you can construct fragments which +are assembled when a condition is met. +Conditional constructions can be nested.
+Example: +
noscr equ 1
 widescr equ 1
  ift noscr
  lda #0
@@ -676,139 +417,125 @@ widescr equ 1
  lda #$22
  eif
  sta $22f
-
-Above example can be rewritten using line repeating feature: -
noscr equ 1
+
+The above example can be rewritten using the line repeating feature: +
noscr equ 1
 widescr equ 1
 :noscr lda #0
 :!noscr&&widescr lda #$23
 :!noscr&&!widescr lda #$22
  sta $22f
-
- -
-
-

Pseudo-commands

-Pseudo-commands are built-in macros. -They are not unofficial instructions, so they work on typical 6502.

-

-
ADD - addition without carry -
If you have ever programmed 6502, you must have noticed that you had -to use a CLC before ADC for every simple addition.
-X-Asm can do it for you. ADD replaces two instructions: -CLC and ADC.

- -

SUB - subtraction -
It is SEC and SBC.

- - -

RCC, RCS, REQ, RMI, RNE, RPL, RVC, RVS - conditional repeat -
These are branches to the previous instruction. +
+
+

PSEUDO-COMMANDS

+

Pseudo-commands are built-in macros.

+
+
ADD - addition without carry
+
If you have ever programmed a 6502, you must have noticed that you had +to use a CLC before ADC for every simple addition.
+xasm can do it for you. ADD replaces two instructions: +CLC and ADC.
+
SUB - subtraction
+
It is SEC and SBC.
+
RCC, RCS, REQ, RMI, RNE, RPL, RVC, +RVS - conditional repeat
+
These are branches to the previous instruction. They take no operand, because the branch target -is the address of previously assembled instruction.
+is the address of previously assembled instruction.
Example: -
 ldx #0
+
 ldx #0
  mva:rne $500,x $600,x+
-
+
The example code copies memory $500-$5ff to $600-$6ff. Here is the same written with standard 6502 commands only: -
 ldx #0
+
 ldx #0
 loop lda $500,x
  sta $600,x
  inx
  bne loop
-
- -
SCC, SCS, SEQ, SMI, SNE, SPL, SVC, SVS - conditional skip -
These are branches over the next instructions. No operand is required, -because the target is the address of instruction following -the next instruction.
+
+
SCC, SCS, SEQ, SMI, SNE, SPL, SVC, SVS - conditional +skip
+
These are branches over the next instructions. No operand is required, +because the target is the address of the instruction following +the next instruction.
Example: -
 lda #40
+
 lda #40
  add:sta $80
  scc:inc $81
-
-In the above example word-size variable $80 is incremented by 40.
-Nor conditional repeat nor skip pseudo-commands require operand, -thus they can be paired with any other command.

- -

JCC, JCS, JEQ, JMI, JNE, JPL, JVC, JVS - conditional jumps -
These are a kind of 'long' branches. While standard branches -(BNE, BEQ) have range of -128..+127, these jumps have range -of all 64 kB.
+
+In the above example the word-sized variable $80 is incremented by 40.
+
JCC, JCS, JEQ, JMI, JNE, JPL, JVC, JVS - conditional +jumps
+
These are a kind of 'long' branches. While standard branches +(such as BNE) have range of -128..+127, these jumps have range +of all 64 kB.
Example: -
 jne dest
-
is equivalent to: -
 seq:jmp dest
-
- -
INW - increment word -
Increments a 16-bit word in the memory.
+
 jne dest
+
is equivalent to: +
 seq:jmp dest
+
+
INW - increment word
+
Increments a 16-bit word in the memory.
Example: -
 inw dest
-
is equivalent to: -
 inc dest
+
 inw dest
+
is equivalent to: +
 inc dest
  sne:inc dest+1
-
- -
MVA, MVX, MVY - move byte using accumulator, X or Y -
Each of these pseudo-commands requires two operands +
+
MVA, MVX, MVY - move byte using accumulator, X or Y
+
Each of these pseudo-commands requires two operands and substitutes two commands: -
 mva source dest = lda source : sta dest
+
 mva source dest = lda source : sta dest
  mvx source dest = ldx source : stx dest
  mvy source dest = ldy source : sty dest
-
- -
-
MWA, MWX, MWY - move word using accumulator, X or Y -
These pseudo-commands require two operands -and are combinations of two MV*'s: -one to move low byte, and the other to move high byte.
-You can't use indirect nor pseudo addressing mode with MW*. -Destination must be absolute address (optionally indexed).
-When source is also absolute, a mw* source dest will be: -
 mv* source   dest
+
+
MWA, MWX, MWY - move word using +accumulator, X or Y
+
These pseudo-commands require two operands +and are combinations of two MV*'s: +one to move the low byte, and the other to move the high byte.
+You can't use indirect nor pseudo addressing mode with MW*. +Destination must be an absolute address (optionally indexed).
+When source is also absolute, an mw* source dest will be: +
 mv* source  dest
  mv* source+1 dest+1
-
-When source is an immediate, a mw* #immed dest will be: -
 mv* <immed dest
+
+When source is an immediate, an mw* #immed dest will be: +
 mv* <immed dest
  mv* >immed dest+1
-
-When <immed equals >immed and immed -is not forward-referenced, X-Asm uses optimization: -
 mv* <immed dest
+
+When <immed equals >immed and immed +is not forward-referenced, xasm uses an optimization: +
 mv* <immed dest
  st* dest+1
-
-If possible, MWX and MWY use increment/decrement -commands. E.g. mwx #1 dest is assembled as: -
 mvx #1 dest
+
+If possible, MWX and MWY use increment/decrement +commands. E.g. mwx #1 dest is assembled as: +
 ldx #1
+ stx dest
  dex
  stx dest+1
-
- - -
-

Addressing modes

-All addressing modes are entered in standard convention except -the accumulator addressing mode, which should be marked with a -@ character (as in Quick Assembler).

- -There are two extra immediate addressing modes: -< and >, -which use low/high byte of 16-bit word constant. +

+
+

ADDRESSING MODES

+

All addressing modes are entered in the standard 6502 convention except for +the accumulator addressing mode, which should be marked with +the @ character (as in Quick Assembler).

+

There are two extra immediate addressing modes: +< and >, +which use the low/high byte of a 16-bit word constant. They are for Quick Assembler compatibility. -You can use traditional #< and #>. -Note lda >$ff+5 loads 1 (>$104), -while lda #>$ff+5 -loads 5 (0+5) to accumulator, because unary operator > -has higher priority than the binary plus.

- -In absolute addressing modes, X-Asm examines the expression and uses zero-page -addressing mode if it supposes it's possible. You may override it with -a: and z: prefixes.

- -Examples: -

+You can use traditional #< and #>.
+Note lda >$ff+5 loads 1 (>$104),
+while lda #>$ff+5
+loads 5 (0+5) to the accumulator, because the unary operator
+> has a higher priority than the binary plus.

+

In absolute addressing modes, xasm examines the expression +and uses zero-page addressing mode if it supposes it's possible. +You may override it with a: and z: prefixes.

+

Examples:

+
  nop
  asl @
  lda >$1234	assembles to lda #$12
@@ -816,89 +543,157 @@ Examples:
  lda a:0	generates 16-bit address
  jmp ($0a)
  lda ($80),y
-
- -There are also pseudo addressing modes, which are similar to +
+

There are also pseudo addressing modes, which are similar to pseudo-commands. You may use them just like standard addressing modes in all 6502 commands and pseudo-commands, except for -MWA, MWX and MWY: -

 cmd a,x+    =  cmd a,x   : inx
- cmd a,x-    =  cmd a,x   : dex
- cmd a,y+    =  cmd a,y   : iny
- cmd a,y-    =  cmd a,y   : dey
- cmd (z),y+  =  cmd (z),y : iny
- cmd (z),y-  =  cmd (z),y : dey
- cmd (z,0)   =  ldx #0    : cmd (z,x)
- cmd (z),0   =  ldy #0    : cmd (z),y
- cmd (z),0+  =  ldy #0    : cmd (z),y : iny
- cmd (z),0-  =  ldy #0    : cmd (z),y : dey
-
- -
-

FAQ

-Note: All the following things, which may be odd for you, -are familiar to Quick Assembler users. - -If you have other questions/problems, -
contact me. -


Back - \ No newline at end of file +MWA, MWX and MWY:

+
 cmd a,x+   =  cmd a,x   : inx
+ cmd a,x-   =  cmd a,x   : dex
+ cmd a,y+   =  cmd a,y   : iny
+ cmd a,y-   =  cmd a,y   : dey
+ cmd (z),y+ =  cmd (z),y : iny
+ cmd (z),y- =  cmd (z),y : dey
+ cmd (z,0)  =  ldx #0    : cmd (z,x)
+ cmd (z),0  =  ldy #0    : cmd (z),y
+ cmd (z),0+ =  ldy #0    : cmd (z),y : iny
+ cmd (z),0- =  ldy #0    : cmd (z),y : dey
+
+

CHANGES

+

Version 2.6.0 (2005-02-07)

+
+

Version 2.5.2 (2002-10-03)

+ +

Version 2.5.1 (2002-08-21)

+ +

Version 2.5 (2002-07-08)

+ +

Version 2.4.1 (2002-06-27)

+ +

Version 2.4 (2002-05-22)

+ +

Version 2.3 (2002-02-10)

+ +

Version 2.2 (1999-09-10)

+ +

Version 2.0 (1998-11-12)

+ +

Version 1.2 (1998-08-14)

+ +

AUTHOR

+

Piotr Fusik (fox@scene.pl)

+

SEE ALSO

+

How to configure a text editor for a convenient use +of xasm

+

xasm home page +(http://xasm.atari.org)

+ + diff --git a/doc/xboot.htm b/doc/xboot.htm deleted file mode 100644 index 7117eff..0000000 --- a/doc/xboot.htm +++ /dev/null @@ -1,98 +0,0 @@ - - -X-BOOT 5.0 - - -
-

X-BOOT version 5.0

-
-
- -

INTRODUCTION

-This tool converts Atari executable files to disk images (ATR). -Since its first version, X-BOOT lost significance, because now you -can load an executable directly to Atari (e.g. using -X-LOAD), and the emulators (e.g. -Atari800Win PLus). -However, X-BOOT may still be useful, especially when using -professional loader. -

CHANGES

-

Version 5.0

- -

Version 4.0

- -

Version 3.2

- -

Version 3.1

- - -
-

USAGE

-Syntax for invoking X-BOOT is following:

-XBOOT [/p] obxfiles [atrpath][atrfile]

-Parameters in brackets are optional.

-If file name extension is omitted, the default .OBX or .ATR is added. -If no atrpath is given, disk images are written by default in -the directory where executables are.

-If file name contains spaces, you should enclose it in quotation marks.

-/p switch (or equivalent -p) forces writing 'professional -loader', which allows you to load code/data intro the RAM under ROM and starts -the program with disabled ROM and interrupts. By default, standard loader is -used, which can load any Atari executable not demanding DOS nor any special -loader.

-Both loaders disable Atari Basic, so you don't need to hold the OPTION key -while booting.

-Below are some examples:

-

-
XBOOT -p test -
Converts test.obx to test.atr in current directory -using professional loader. -
XBOOT d:\games\*.xex \atrs\ -
Converts all files in d:\games with .xex extension -and writes disk images to directory \atrs on current drive -using standard loader. -
XBOOT "c:\test\Very Long File Name.AtariExecutable" /p -
Converts c:\test\Very Long File Name.AtariExecutable to -c:\test\Very Long File Name.atr using professional loader. -
XBOOT d:* /p . -
Converts all .OBX files in current directory on d: -to current directory on current drive using professional loader. -
-
-

DETAILS

-Produced ATR is single density and as short as possible. -Loader occupies one boot sector.

-X-BOOT does not store the executable file in ATR as an Atari file. -You can't read it from an Atari DOS nor extract it somehow or other. -You can only run it by booting.

-For more details, read source files of the loaders: -

-Loaders are so simple that they even do not detect end of file. Instead, -they are modified when end of file is reached. The disk image contains one -additional block, which doesn't belong to the executable file, but alters -the loader to run the program instead of initializing. -


Back - - \ No newline at end of file diff --git a/doc/xbootpro.asx b/doc/xbootpro.asx deleted file mode 100644 index 1a79b61..0000000 --- a/doc/xbootpro.asx +++ /dev/null @@ -1,64 +0,0 @@ -* Boot executable file loader coded by Fox/Taquart -* Reads file from ATR prepared with X-BOOT. -* Professional version - can load file under ROM. -* Interrupts and ROM are disabled when running loaded program. - - opt h- - org $480 - -bufr equ $400 128-byte buffer - -tp equ $43 Temporary byte -vc equ $44 Start and end vectors (4 bytes) - -* Boot code -boot dta b(0,1),a(boot,$e477) Boot header - mva #0 $22f Make screen blank... - mva #$52 $2c8 ... and pink ;) - lda 20 Wait for VBLK - cmp:req 20 - mwa #rts $2e0 Set default run vector - dta b({lda a:0}) Skip two bytes -secrts sec Return with error -rts rts - mva:pha >rts $2e3 Set init address... - mva:pha boot+$80 Exactly 128 bytes should be used - -* X-BOOT adds this block at the end of loaded file -* It changes jmp ($2e2) to jmp ($2e0) - opt h+ - org init+1 - dta l($2e0) - - end \ No newline at end of file diff --git a/doc/xbootstd.asx b/doc/xbootstd.asx deleted file mode 100644 index 303fc07..0000000 --- a/doc/xbootstd.asx +++ /dev/null @@ -1,63 +0,0 @@ -* Boot executable file loader coded by Fox/Taquart -* Reads file from ATR prepared with X-BOOT. -* Standard loader - ROM and interrupts enabled. - - opt h- - org $780 - -bufr equ $700 128-byte buffer - -tp equ $43 Temporary byte -vc equ $44 Start and end vectors (4 bytes) - -* Boot code -boot dta b(0,1),a(boot,$e477) Boot header -txtpos equ 215 - ldy #txtpos Print text -print mva text-txtpos,y ($58),y+ - cpy #txtpos+txtlen - bcc print - mwa #rts $2e0 Set default run vector - mva >bufr $305 Set buffer address - mva #$ff ^31 Turn BASIC off - dta b({lda a:0}) Skip two bytes -secrts sec Return with error -rts rts - mva:pha >rts $2e3 Set init address... - mva:pha boot+$80 Exactly 128 bytes should be used - -* X-BOOT adds this block at the end of loaded file -* It changes jmp ($2e2) to jmp ($2e0) - opt h+ - org init+1 - dta l($2e0) - - end \ No newline at end of file diff --git a/doc/xhead.htm b/doc/xhead.htm deleted file mode 100644 index b5a4252..0000000 --- a/doc/xhead.htm +++ /dev/null @@ -1,45 +0,0 @@ - - -X-HEAD 1.1 - - -

-

X-HEAD version 1.1

-
-
- -

INTRODUCTION

-This tool prints headers of an Atari executable file. -It shows, into which memory areas the file loads, -and what are init and run addresses.

-Important note: X-HEAD is an extremely simple tool. Jindrich Kubec -wrote a tool with similar purpose, but much more features (disassembly -in different formats, including X-Assembler), called ChkExe. -You can find it on -http://jindroush.atari.org. -

CHANGES

-

Version 1.1

- -

Version 1.0

- - -
-

USAGE

-Simply run X-HEAD with executable filename. No options are supported.

-X-HEAD will read the file and display its headers in following format: -

 bbbb-eeee xxxx
-where bbbb is the begin, eeee - the end of the block, -and xxxx is the execution (init or run) address.

-The summary includes:
-xxxx bytes - length of file, including headers
-xxxx blocks - number of headers
-xxxx inits - number of init blocks (02e2-02e3)
-xxxx modules - number of FFFF headers (one at the beginning is required)

-All displayed numbers are hexadecimal, of course. -


Back - - \ No newline at end of file diff --git a/doc/xload.htm b/doc/xload.htm deleted file mode 100644 index 64f3395..0000000 --- a/doc/xload.htm +++ /dev/null @@ -1,85 +0,0 @@ - - -X-LOAD 1.1 - - -

-

X-LOAD version 1.1

-
-
- -

INTRODUCTION

-This tool may be used to load an Atari executable file, stored on the PC, -into a real Atari computer, via the SIO2PC interface. -Only data input and data output lines are used, so X-LOAD should work -with all types of the interface.

-It is experimental version. I'm not sure if it will work -with every hardware. I've noticed it is not stable and sometimes -transmission can hang or distortions in loaded data may appear. -The reason is that there is no error-checking, while transmission is -fast (57.6 kbits/sec).

-

CHANGES

-

Version 1.1

- -

Version 1.0

- - -
-

USAGE

-You should pass as the parameters the executable file name and optionally -the options:

-

-
/1 - /4 -
Serial port number. Default is 2.

-

/p -
Force using 'professional loader', which allows you to load code/data -into the RAM under ROM ($c000-$ffff) and starts the program with disabled -ROM and interrupts. By default, standard loader is used, which can load -any Atari executable not demanding DOS or any special loader.

-

-After you run X-LOAD, you only have to boot your Atari and the program -will be loaded and run.

-While loading, PC prints memory locations, which the program loads into.

-After the program is loaded and run, X-LOAD terminates. You may exit it -earlier at any time by pressing the ESC key.

- -


-

DETAILS

-First, X-LOAD sends a byte to Atari and then waits until the Atari is booted. -The byte can be used to detect from Atari, that PC is ready for transmission. -When you are testing your program, you may code periodic checking -if a byte was received, and performing cold reset in that case. -So you don't need to touch your Atari to run your program on it.

-While booting, X-LOAD accepts two commands for disk drive 1:

-

-After the Atari receives and runs the loader, the transmission runs at 57600 -bits/sec.

-The transmission protocol is very simple: Atari sends a byte to inform that -it is ready for receiving data. Then PC sends a 3-byte header and a block -of data. First two bytes of the header are the high and the low byte of the -address of the last byte in the block minus $ff. Third byte equals low byte -of ($100-block_length). Then come block data, which are loaded directly -into their memory locations. -For more details, view source files of the loaders: -

-You may have noticed that X-LOAD is somehow similar to X-BOOT, which also -has two loaders. The main difference is that X-BOOT loaders use system -routines to get sectors at regular speed of 19200 bits/sec. -They use sector buffer and require some low memory locations not to be altered -because of Atari operating system. In this respect X-LOAD loaders are better, -because they allow loading into whole memory except for the loader code. -


Back - - \ No newline at end of file diff --git a/doc/xloadpro.asx b/doc/xloadpro.asx deleted file mode 100644 index c86a7e4..0000000 --- a/doc/xloadpro.asx +++ /dev/null @@ -1,60 +0,0 @@ -* Boot executable file loader coded by Fox/Taquart -* Receives file from X-LOAD via SIO2PC interface. -* Professional version - can load file under ROM. -* Interrupts and ROM are disabled when running loaded program. - - opt h- - org $400 - -* Boot code -boot dta b(0,1),a(boot) Boot header -arts dta a(rts) - - dta b({lda #$60}) Skip rts -rts rts - - sei Disable interrupts - inc ^4e - inc ^40 Make screen blank - mva #$08 ^24 Set transmission speed - mva #$00 ^26 - mva #$28 ^28 - sta ^29 Reset counters - mva #$23 ^2f Send enable - sta ^2d Send a byte -wait sta ^4a Wait until sent - asl @ - bcc wait - mva #$13 ^2f Receive enable - ldy #2 -head jsr get Receive address (high/low byte) - sta stor,y - mva arts-1,y $2e2-1,y Set init address - pha Put return address on stack - dey - bne head - jsr get Receive length (one byte) - tax -load jsr get Receive data -stor sta a:0,x+ Store in memory - bne load - mva $10 ^2e Reset POKEY - mva #3 ^2f -init jmp ($2e2) Call init routine - -get lda #$20 Function: Receive one byte - sta ^2e Enable receive interrupt - bit:rne ^2e Wait for interrupt request - sty ^2e Disable receive interrupt - lda ^2d Get byte - rts - -:boot+$80-* dta b(0) Padd with zeros to full sector - -* X-LOAD adds this block at the end of loaded file -* It changes jmp ($2e2) to jmp ($2e0) - opt h+ - org init+1 - dta l($2e0) - - end \ No newline at end of file diff --git a/doc/xloadstd.asx b/doc/xloadstd.asx deleted file mode 100644 index 258e18d..0000000 --- a/doc/xloadstd.asx +++ /dev/null @@ -1,60 +0,0 @@ -* Boot executable file loader coded by Fox/Taquart -* Receives file from X-LOAD via SIO2PC interface. -* Standard loader - ROM and interrupts enabled while running loaded program. - - opt h- - org $700 - -* Boot code -boot dta b(0,1),a(boot) Boot header -arts dta a(rts) - - dta b({lda #$60}) Skip rts -rts rts - - sei Disable interrupts - inc ^4e - mva #$08 ^24 Set transmission speed - mva #$00 ^26 - mva #$28 ^28 - sta ^29 Reset counters - mva #$23 ^2f Send enable - sta ^2d Send a byte -wait sta ^4a Wait until sent - asl @ - bcc wait - mva #$13 ^2f Receive enable - ldy #2 -head jsr get Receive address (high/low byte) - sta stor,y - mva arts-1,y $2e2-1,y Set init address - pha Put return address on stack - dey - bne head - jsr get Receive length (one byte) - tax -load jsr get Receive data -stor sta a:0,x+ Store in memory - bne load - mva $10 ^2e Reset POKEY - mva #3 ^2f - lsr ^4e Enable interrupts - cli -init jmp ($2e2) Call init routine - -get lda #$20 Function: Receive one byte - sta ^2e Enable receive interrupt - bit:rne ^2e Wait for interrupt request - sty ^2e Disable receive interrupt - lda ^2d Get byte - rts - -:boot+$80-* dta b(0) Padd with zeros to full sector - -* X-LOAD adds this block at the end of loaded file -* It changes jmp ($2e2) to jmp ($2e0) - opt h+ - org init+1 - dta l($2e0) - - end \ No newline at end of file diff --git a/file_id.diz b/file_id.diz deleted file mode 100644 index d085cd9..0000000 --- a/file_id.diz +++ /dev/null @@ -1,5 +0,0 @@ ---== xasm 2.5.2: second final edition ==-- -interactive visual development environment - only for 8-bit Atari programming gurus - - requirements: 386 + DOS or Windows diff --git a/fox.mak b/fox.mak deleted file mode 100644 index 17a0fdd..0000000 --- a/fox.mak +++ /dev/null @@ -1,248 +0,0 @@ -;b. Fox/Tqa - -eol equ 13,10 -eot equ 13,10,'$' - -;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± - -MACRO lda _rg ;shorter than 'mov (e)ax, _rg' -_rge SUBSTR <_rg>, 1, 1 -IFIDNI _rge, - xchg eax, _rg -ELSE - xchg ax, _rg -ENDIF - ENDM - -MACRO sta _rg ;shorter than 'mov _rg, (e)ax' -_rge SUBSTR <_rg>, 1, 1 -IFIDNI _rge, - xchg _rg, eax -ELSE - xchg _rg, ax -ENDIF - ENDM - -;±±±±±±± DOS / FILE I/O ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± - -MACRO dos _func -IFNB <_func> -IF _func and 0ff00h - mov ax, _func -ELSE - mov ah, _func -ENDIF -ENDIF - int 21h - ENDM - -MACRO file _func -IFNB <_func> -IF _func and 0ff00h - mov ax, _func -ELSE - mov ah, _func -ENDIF -ENDIF -IFDEF smartio - call xdisk -ELSE - int 21h -ENDIF - ENDM - -MACRO smartdisk -smartio = 1 -xdisk: dos -IFDEF rts - jnc rts -ELSE - jc _derr - ret -_derr: -ENDIF - mov dx, offset errtxt - jmp panic -ENDM - -MACRO smarterr -errtxt db 'Disk error!',eot - ENDM - -MACRO fcreate _fname ; ENTRY: DS:_fname|dx = ASCIIZ fname, RETURN: bx = handle -IFNB <_fname> - mov dx, offset _fname -ENDIF - xor cx, cx - file 3ch - sta bx - ENDM - -MACRO fopen _fname ; ENTRY: DS:_fname|dx = ASCIIZ fname, RETURN: bx = handle -IFNB <_fname> - mov dx, offset _fname -ENDIF - file 3d00h - sta bx - ENDM - -MACRO fupdate _fname ; ENTRY: DS:_fname|dx = ASCIIZ fname, RETURN: bx = handle -IFNB <_fname> - mov dx, offset _fname -ENDIF - file 3d02h - sta bx - ENDM - -MACRO fclose ; ENTRY: bx = handle - file 3eh - ENDM - -MACRO fread _fbufr ; ENTRY: DS:_fbufr = buffer, cx = no. of bytes -IFNB <_fbufr> - mov dx, offset _fbufr -ENDIF - file 3fh - ENDM - -MACRO fwrite _fbufr ; ENTRY: DS:_fbufr = buffer, cx = no. of bytes -IFNB <_fbufr> - mov dx, offset _fbufr -ENDIF - file 40h - ENDM - -;±±±±±±± PRINT ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± - -MACRO print _text -IFNB <_text> - mov dx, offset _text -ENDIF - dos 9 - ENDM - -MACRO PEOL - mov dl, 13 - dos 2 - mov dl, 10 - dos 2 - ENDM - -MACRO PrintAXdec -LOCAL _outn1,_outn2,_dectxt,_cont - mov di, offset _dectxt+4 - mov bx, 10 -_outn1: xor dx, dx - div bx - add dl, '0' -_outn2: mov [di], dl - dec di - test ax, ax - jnz _outn1 - mov dl, ' ' - cmp di, offset _dectxt - jnb _outn2 - print _dectxt - jmp _cont -_dectxt db 5 dup(' '),eot -_cont: - ENDM - -MACRO PrintEAXdec -LOCAL _outn1,_outn2,_dectxt,_cont - mov di, offset _dectxt+9 - mov ebx, 10 -_outn1: xor edx, edx - div ebx - add dl, '0' -_outn2: mov [di], dl - dec di - test eax, eax - jnz _outn1 - mov dl, ' ' - cmp di, offset _dectxt - jnb _outn2 - print _dectxt - jmp _cont -_dectxt db 10 dup(' '),eot -_cont: - ENDM - -MACRO D2A - cmp al, 10 - sbb al, 69h - das - ENDM - -MACRO Printdig - d2a - sta dx - dos 2 - ENDM - -MACRO PrintAL - push ax - shr al, 4 - PrintDig - pop ax - and al, 0fh - PrintDig - ENDM - -MACRO PrintAX - push ax - mov al, ah - PrintAL - pop ax - PrintAL - ENDM - -MACRO PrintEAX - push ax - shr eax, 16 - PrintAX - pop ax - PrintAX - ENDM - -;±±±±±±± GFX ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± - -MACRO setgfx _gmode - mov ax, _gmode - int 10h - ENDM - -MACRO bar _jaki -IFDEF bars - mov dx, 3c8h - mov al, 0 - out dx, al - inc dx - mov al, _jaki - out dx, al - out dx, al - out dx, al -ENDIF - ENDM - -MACRO EndVBl -LOCAL w1,w2 - mov dx, 3dah - w1: in al, dx - test al, 8 - jz w1 - w2: in al, dx - test al, 8 - jnz w2 - ENDM - -MACRO StartVBL -LOCAL w1,w2 - mov dx, 3dah - w1: in al, dx - test al, 8 - jnz w1 - w2: in al, dx - test al, 8 - jz w2 - ENDM \ No newline at end of file diff --git a/syntax/X-Assembler.cgsyn b/syntax/xasm.cgsyn similarity index 91% rename from syntax/X-Assembler.cgsyn rename to syntax/xasm.cgsyn index e40df19..95eeac0 100644 --- a/syntax/X-Assembler.cgsyn +++ b/syntax/xasm.cgsyn @@ -1,4 +1,4 @@ -# X-Assembler syntax for Code-Genie 3.0 (www.code-genie.com) +# xasm syntax for Code-Genie 3.0 (www.code-genie.com) # written by Piotr Fusik CaseInsensitive true diff --git a/syntax/X-Assembler.chl b/syntax/xasm.chl similarity index 88% rename from syntax/X-Assembler.chl rename to syntax/xasm.chl index 36760bd..8586bd0 100644 --- a/syntax/X-Assembler.chl +++ b/syntax/xasm.chl @@ -1,8 +1,8 @@ -// X-Assembler highlighter for ConTEXT v0.97.1 (www.fixedsys.com/context) +// xasm highlighter for ConTEXT v0.97.1 (www.fixedsys.com/context) // written by Piotr Fusik -Language: X-Assembler -Filter: X-Assembler files (*.asx)|*.asx +Language: xasm +Filter: xasm files (*.asx)|*.asx HelpFile: CaseSensitive: 0 diff --git a/syntax/xasm.ini b/syntax/xasm.ini new file mode 100644 index 0000000..9093dbd --- /dev/null +++ b/syntax/xasm.ini @@ -0,0 +1,134 @@ +# xasm highlighter for PSPad 4.2.1 (pspad.zde.cz) +# written by Piotr Fusik +[Settings] +Name=xasm +HTMLGroup=0 +FileType=*.asx +CommentString= +ANSIComment=0 +PasComment=0 +SlashComment=0 +CComment=0 +SpecComment=0 +BasComment=1 +FoxComment=0 +REMComment=0 +ExclComment=0 +ByComment=0 +SharpComment=0 +SlashComment=0 +PerCentComment=0 +SinglQComment=0 +DblQComment=0 +SQLComment=0 +SingleQuote=1 +DoubleQuote=1 +Preprocessors=0 +IndentChar= +UnIndentChar= +TabWidth=0 +[KeyWords] +ADC= +ADD= +AND= +ASL= +BCC= +BCS= +BEQ= +BIT= +BMI= +BNE= +BPL= +BRK= +BVC= +BVS= +CLC= +CLD= +CLI= +CLV= +CMP= +CPX= +CPY= +DEC= +DEX= +DEY= +EOR= +INC= +INW= +INX= +INY= +JCC= +JCS= +JEQ= +JMI= +JMP= +JNE= +JPL= +JSR= +JVC= +JVS= +LDA= +LDX= +LDY= +LSR= +MVA= +MVX= +MVY= +MWA= +MWX= +MWY= +NOP= +ORA= +PHA= +PHP= +PLA= +PLP= +RCC= +RCS= +REQ= +RMI= +RNE= +ROL= +ROR= +RPL= +RTI= +RTS= +RVC= +RVS= +SBC= +SCC= +SCS= +SEC= +SED= +SEI= +SEQ= +SMI= +SNE= +SPL= +STA= +STX= +STY= +SUB= +SVC= +SVS= +TAX= +TAY= +TSX= +TXA= +TXS= +TYA= +[ReservedWords] +DTA= +EIF= +ELI= +ELS= +END= +EQU= +ERT= +ICL= +IFT= +INI= +INS= +OPT= +ORG= +RUN= diff --git a/syntax/xasm.stx b/syntax/xasm.stx index 78d29e7..344715d 100644 --- a/syntax/xasm.stx +++ b/syntax/xasm.stx @@ -1,5 +1,5 @@ -#TITLE=X-Assembler -; X-Assembler syntax file for EditPlus 2.11 (www.editplus.com) +#TITLE=xasm +; xasm syntax file for EditPlus 2.11 (www.editplus.com) ; written by Piotr Fusik #DELIMITER=+-*/%&|^!~=<>()[]{},:"# diff --git a/www/cgenie.gif b/www/cgenie.gif index 3760799..64d4c3a 100644 Binary files a/www/cgenie.gif and b/www/cgenie.gif differ diff --git a/www/gbak.gif b/www/gbak.gif deleted file mode 100644 index 219d6fa..0000000 Binary files a/www/gbak.gif and /dev/null differ diff --git a/www/green64.gif b/www/green64.gif deleted file mode 100644 index 16d5530..0000000 Binary files a/www/green64.gif and /dev/null differ diff --git a/www/index.html b/www/index.html index 11492df..83d19f3 100644 --- a/www/index.html +++ b/www/index.html @@ -1,50 +1,79 @@ - - -xasm home page - - - - - - - -
-  xasm home page
-

-xasm is a set of a few tools for developing software for Atari 8-bit computers -on a PC with MS-DOS or Windows.

-Download (38 KB) | -Browse documentation on-line | -E-mail me -

- - - -
Some 6502 code in Code-Genie -

-News: -

    -
  • 03-10-2002: released version 2.5.2 (fixes bugs introduced in 2.5.1) -
  • 21-08-2002: released version 2.5.1 (a small bug fix) -
  • 08-07-2002: released version 2.5 -
  • 27-06-2002: released version 2.4.1 (a small bug fix) -
  • 22-05-2002: released version 2.4 -
-


-Features of the assembler: -

    -
  • backward compatibility with Quick Assembler -
  • pseudo instructions (add, sub, inw, mva etc.) -
  • pseudo addressing modes (e.g. indexing with autoincrementation) -
  • two instructions with same operand may be written in single line -
  • full set of arithmetic and logical operators -
  • 6502 opcodes may be used in expressions -
  • conditional assembly -
  • sine lookup-table generator -
  • Atari floating-point numbers -
  • Atari executable and raw output formats -
-
-

- \ No newline at end of file + + + +xasm + + + + + +

xasm.atari.org

+

xasm is a 6502 cross-assembler for DOS/Windows. +It is mainly targeted at Atari 8-bit computers, +but it can be also used for programming +Atari 2600/5200/Lynx, Commodore C64, Apple ][ and others. +xasm is freeware.

+

Download version 2.6.0 +(22 KB, includes full documentation)

+

xasm no longer includes the tools X-BOOT, X-LOAD and X-HEAD. +If you really need them, +download version 2.5.2 (38 KB).

+

Target audience

+

xasm is for people who are fluent in the 6502 assembly language. +There is no sample code for beginners, no easy-to-use libraries. +You are warned that programming 8-bit machines in the assembly language +is a tedious work.

+

There are several 6502 cross-assemblers to choose from and new ones +still appear. Just search the web. Make sure to not overlook +the cc65 compiler which includes +a cross-assembler, portable across many host and target platforms.

+

Features

+

Although xasm does not support user-defined macros, it has a rich +set of built-in facilities.

+

Here is some typical 6502 code (also valid in xasm):

+
+        lda #<dest
+        sta ptr
+        lda #>dest
+        sta ptr+1
+        ldx #192
+do_line
+        ldy #39
+do_byte
+        lda pattern,y
+        sta (ptr),y
+        dey
+        bpl do_byte
+        lda #40
+        clc
+        adc ptr
+        sta ptr
+        bcc skip
+        inc ptr+1
+skip
+        dex
+        bne do_line
+
+

And here is the same code rewritten in a xasm-specific way:

+
+        mwa     #dest ptr
+        ldx     #192
+do_line
+        ldy     #39
+        mva:rpl pattern,y (ptr),y-
+        lda #40
+        add:sta ptr
+        scc:inc ptr+1
+        dex:bne do_line
+
+

Usage

+

Although xasm comes with no editor, the documentation +describes integration (syntax highlighting and single-keystroke compilation) +with a few general-purpose text editors. Here is a screenshot +of the Code-Genie editor:

+

6502 code in Code-Genie

+
+

Hosted by Atari Area

+ + diff --git a/xboot.asm b/xboot.asm deleted file mode 100644 index 5af5d3e..0000000 --- a/xboot.asm +++ /dev/null @@ -1,631 +0,0 @@ -; ><-B00T V b. Fox - - IDEAL - P386 - MODEL TINY - CODESEG -zero db 100h dup(?) - -blen = 59*1024 - -m_pro = 1 ; /p switch -m_errs = 2 ; error/warning occured while current file -m_file = 4 ; single file (atr name for one file given) -m_lfn = 8 ; LFN search - -eol equ 13,10 -eot equ 13,10,'$' - -struc finddata16 - db 21 dup(?) -attr db ? -time dw ? -date dw ? -fsize dd ? -fname db 13 dup(?) - ends - -struc filetime32 - dd ?,? - ends - -struc finddata32 -attr dd ? -creat filetime32 ? -acces filetime32 ? -write filetime32 ? -fsizeh dd ? -fsizel dd ? - dd ?,? -fname db 260 dup(?) -aname db 14 dup(?) - ends - -MACRO lda _rg ; shorter than 'mov (e)ax, _rg' -_rge SUBSTR <_rg>, 1, 1 -IFIDNI _rge, - xchg eax, _rg -ELSE - xchg ax, _rg -ENDIF - ENDM - -MACRO sta _rg ; shorter than 'mov _rg, (e)ax' -_rge SUBSTR <_rg>, 1, 1 -IFIDNI _rge, - xchg _rg, eax -ELSE - xchg _rg, ax -ENDIF - ENDM - -MACRO dos _func ; call DOS function -IFNB <_func> -IF _func and 0ff00h - mov ax, _func -ELSE - mov ah, _func -ENDIF -ENDIF - int 21h - ENDM - -MACRO file _func -IFNB <_func> -IF _func and 0ff00h - mov ax, _func -ELSE - mov ah, _func -ENDIF -ENDIF - call xdisk - ENDM - -MACRO jfile _func -IFNB <_func> -IF _func and 0ff00h - mov ax, _func -ELSE - mov ah, _func -ENDIF -ENDIF - jmp xdisk - ENDM - -MACRO print _text ; print ascii$ text -IFNB <_text> - mov dx, offset _text -ENDIF - dos 9 - ENDM - - -start: - db 1536 dup(0) ; COMpack sux - mov [spt], sp - print hello - -; Get arguments: obxnam, atrnam & /p switch -; Set onam & anam to end of filenames - mov si, 81h - mov bx, offset onam - -arg1: lodsb - cmp al, ' ' - je arg1 ; skip spaces - cmp al, '-' - je swit - cmp al, '/' - jne nswit -; Switch -swit: lodsb - and al, 0dfh - cmp al, 'P' - jne usg - or [flags], m_pro ; '/P' - jmp arg1 - -nswit: cmp al, 0dh - je argx -; Filename - cmp bx, offset enam - jae usg ; two names already parsed - mov di, [bx] - mov ah, '"' - cmp al, ah - je qname ; "file name with spaces" - mov ah, ' ' -gname: stosb ; copy name -qname: lodsb - cmp al, ah ; space/'"', eol and '/' terminate name - je xname - cmp al, 0dh - je bname - cmp al, '/' - jne gname -bname: dec si -xname: mov [bx], di ; save end of name ptr - inc bx - inc bx - mov [byte di], 0 - jmp arg1 - -; Usage -usg: print usgtxt - dos 4c03h - -; End of arguments -argx: cmp bx, offset anam - jb usg ; no obxnam given - -; Find where obx FILE name begins - mov di, [onam] - lea cx, [di+1+zero-obxnam] -fofna1: dec di - cmp [byte di], '\' - je fofnax - cmp [byte di], ':' - loopne fofna1 -fofnax: inc di - mov [ofna], di - -; Is atr given? - cmp bx, offset anam - ja atrgvn ; atr given - -; Only obx given -; Move path of obx to atrnam - mov si, offset obxnam - mov di, offset atrnam -mobat1: lodsb - stosb - cmp al, '\' - je mobat2 - cmp al, ':' - jne mobat3 -mobat2: mov [anam], di -mobat3: test al, al - jnz mobat1 - mov di, [anam] - mov [byte di], 0 - jmp srvobx - -; Atr given -; Delete trailing '\' if not "\" or "C:\" -atrgvn: mov di, [anam] - dec di - cmp [byte di], '\' - jne atrg1 - mov [anam], di - cmp di, offset atrnam - jbe atrg1 - cmp [byte di-1], ':' - je atrg1 - mov [byte di], 0 -atrg1: -; Check if it is file or dir - mov dx, offset atrnam - xor bx, bx ; try LFN function - stc - dos 7143h - jnc chkafd - cmp ax, 7100h ; LFN not supported - jne afile ; possibly file/dir doesn't exist -> file - dos 43h ; call MS-DOS function 4300h - jc afile ; failed -> file -chkafd: test cl, 10h - jnz adir -; It is file -; Add .atr extension, if none -afile: or [flags], m_file - mov di, [anam] - lea cx, [di+zero-atrnam] - mov eax, 'rta.' - call adext - jmp srvobx -; It is dir -; Add trailing '\' -adir: mov di, [anam] - mov [byte di], '\' - inc [anam] - -; Serve obx -; Add .obx extension, if none -srvobx: mov di, [onam] - lea cx, [di+zero-obxnam] - mov eax, 'xbo.' - call adext - -; Find first file - mov dx, offset obxnam - mov cx, 7 ; try LFN - mov si, 1 - mov di, offset f32 - stc - dos 714eh - jnc flfn - cmp ax, 7100h ; LFN not supported - jne nofil - xor cx, cx ; call MS-DOS function 4Eh - dos 4eh - jnc main1 -nofil: print e_nofil ; "No file found" - dos 4c02h - -flfn: or [flags], m_lfn ; LFN successfull - mov [fhand], ax - -; Main loop - convert found file -main1: and [flags], not m_errs - mov [ohand], 0 - mov [ahand], 0 - mov [len], lodlen+endlen - -; Move name from finddata to obxnam - mov si, offset (finddata16 80h).fname - test [flags], m_lfn - jz nolfn1 - mov si, offset f32.fname -nolfn1: mov di, [ofna] -mona1: lodsb - stosb - test al, al - jnz mona1 - -; Print "file.obx" - mov si, offset obxnam - call printz - -; Open obx for reading - mov bp, offset e_open - mov dx, offset obxnam ; MS-DOS - mov ax, 3d00h - test [flags], m_lfn - jz nolfn2 - mov si, dx ; LFN - xor bx, bx - mov dx, 1 - mov ax, 716ch -nolfn2: file - mov [ohand], ax - -; Check if Atari executable - call xreadh - jb enate - cmp [head], -1 - jne enate - - mov dx, offset head - mov cx, 4 - call xread - jnb nenate -enate: mov dx, offset e_nota - jmp error -nenate: - -; Set default run address at first block - mov ax, [head] - mov [l1runl], al - mov [l2runl], al - mov [l1runh], ah - mov [l2runh], ah - -; Print "->" - print arrow - -; Atr FILE name given? - test [flags], m_file - jnz sfile -; No: move name from obx, replacing extension with ".atr" - mov si, [ofna] - mov di, [anam] -mona2: lodsb - stosb - cmp al, '.' - jne mona2 - mov eax, 'rta' - stosd -sfile: - -; Print "file.atr" - mov si, offset atrnam - call printz ; file.atr - -; Create atr file - mov bp, offset e_creat - mov dx, offset atrnam - xor cx, cx - mov ax, 3c00h - test [flags], m_lfn - jz nolfn3 - mov si, dx - mov bx, 1 - mov dx, 12h ; create or truncate - mov ax, 716ch -nolfn3: file - mov [ahand], ax - -; Print "..." - print kropki - -; Write atr header - mov cx, beglen - mov dx, offset begin - call xwrite -; Write loader in boot sector - mov cx, lodlen - mov dx, offset stdlod - test [flags], m_pro - jz stlo - mov dx, offset prolod -stlo: call xwrite - jmp firs - -; Converting -; Read obx header -skff: call xreadh - jb chtrun - cmp [head], -1 - je skff - mov dx, offset head+2 - call xread2 - jb trunca - -; Read block -firs: mov cx, [head+2] - sub cx, [head] - inc cx - cmp cx, blen - jbe okhead - mov cx, blen -okhead: mov dx, offset blok - call xread - jb trunc -; Write - call xwrihd - jmp skff - -; Check if block is truncated -chtrun: test ax, ax - jnz trunca - jmp finfil - -trunc: test ax, ax - jz finfil - dec ax - push ax - add ax, [head] - mov [head+2], ax - pop ax - call xwrihd - -trunca: mov dx, offset w_trunc -; Warning -warfin: call warni - -; End of file -; Write endsequence -finfil: mov dx, offset endseq1 - test [flags], m_pro - jz endst - mov dx, offset endseq2 -endst: mov cx, endlen - call xwrite - mov cx, 40h - xor ax, ax - mov di, offset head - rep stosw - sta cx - sub cl, [byte len] - and ecx, 7fh - jz fuls - call xwrith -fuls: - -; Write number of paragraphs (para=16 bytes) to atr - xor cx, cx ; seek back to para's atr header field - mov dx, 2 - mov bp, offset e_write - file 4200h - shr [len], 4 - mov cx, 2 - mov dx, offset len - call xwrite - -; Close files -shut: mov bx, [ahand] - mov bp, offset e_write - call xclose - mov bx, [ohand] - mov bp, offset e_read - call xclose - - test [flags], m_errs - jnz nook - print oktxt -nook: print eoltxt - -; Find next file - test [flags], m_lfn - jnz lfnnx - - dos 4fh ; MS-DOS function - jc fin -nexfil: test [flags], m_file - jnz singl - jmp main1 - -lfnnx: mov bx, [fhand] ; LFN function - mov si, 1 - mov di, offset f32 - dos 714fh - jnc nexfil - - dos 71a1h ; LFN search close - -fin: mov ax, [exitcod] - dos - -singl: print e_singl - dos 4c02h - -; Add extension if none (di=end of name, cx=len, eax=ext) -adext: mov bx, di -adext1: dec bx - cmp [byte bx], '.' - je adextr - cmp [byte bx], '\' - loopne adext1 - stosd -adextr: mov [byte di], 0 - ret - -xdisk: push bp - dos - pop dx - jnc rts -error: mov sp, [spt] - mov [byte exitcod], 2 - or [flags], m_errs - print - jmp shut - -warni: cmp [byte exitcod], 1 - jae nwacod - mov [byte exitcod], 1 -nwacod: or [flags], m_errs - print - ret - -xreadh: mov dx, offset head -xread2: mov cx, 2 -xread: mov bx, [ohand] - mov bp, offset e_read - file 3fh - cmp ax, cx -rts: ret - -xwrihd: add ax, 4 - movzx ecx, ax - mov ax, [head] - mov dx, [head+2] - test [flags], m_pro - jnz chkpro - cmp ah, 8 - jae chkst1 - cmp dh, 7 - jae ememc -chkst1: cmp dh, 0c0h - jb xwrith - cmp dh, 0d0h - jb eproc - cmp ah, 0d8h - jb xwrith -eproc: mov dx, offset w_prof - jmp xwwarn - -chkpro: cmp ah, 5 - jae xwrith - cmp dh, 4 - jb xwrith - -ememc: mov dx, offset w_mem -xwwarn: push ecx - call warni - pop ecx - -xwrith: mov dx, offset head -xwritl: add [len], ecx -xwrite: mov bx, [ahand] - mov bp, offset e_write - jfile 40h - -xclose: test bx, bx - jz rts - jfile 3eh - -pnam1: sta dx - dos 2 -printz: lodsb - test al, al - jnz pnam1 - ret - -hello db 'X-BOOT 5.0 by Fox/Taquart',eot -usgtxt db 'Converts Atari 8-bit executables to .ATR disk images.',eol - db 'Syntax: XBOOT [/p] obxfiles [atrpath][atrfile]',eol - db '/p Write professional loader rather than standard.' -eoltxt db eot -arrow db ' -> $' -kropki db ' ... $' -oktxt db 'OK$' -w_mem db eol,' WARNING: Memory conflict$' -w_prof db eol,' WARNING: Professional loader needed$' -w_trunc db eol,' WARNING: File is truncated$' -e_nofil db 'ERROR: File not found',eot -e_singl db 'ERROR: Single target for many files',eot -e_nota db eol,' ERROR: Not Atari executable$' -e_open db eol,' ERROR: Can''t open file$' -e_read db eol,' ERROR: Disk read error$' -e_creat db eol,' ERROR: Can''t create file$' -e_write db eol,' ERROR: Disk write error$' - -; ATR Header -begin dw 296h,0,80h,4 dup(0) - db 0,1 -beglen = $-begin - -; Loader #1 (std) -stdlod db 0,1,128,7,119,228,160,215,185,27,7,145,88,200,192,226,144 - db 246,169 -l1runl db 168,141,224,2,169 -l1runh db 7,141,225,2,169,7,141,5,3,169,255 - db 141,1,211,173,56,96,169,7,141,227,2,72,169,168,141,226,2,72 - db 162,251,149,72,232,134,67,238,210,7,16,16,238,10,3,208,3,238 - db 11,3,32,83,228,48,217,14,210,7,173,127,7,166,67,208,223,129 - db 68,230,68,208,2,230,69,165,70,197,68,165,71,229,69,176,210,169 - db 3,141,15,210,108,226,2,44,111,97,100,105,110,103,14,14,14,0 - db 53,46,48 -lodlen = $-stdlod - -; Ending Header for loader #1 -endseq1 db 240,7,240,7,224 -endlen = $-endseq1 - -; Loader #2 (rom) -prolod db 0,1,128,4,119,228,169,0,141,47,2,169,82,141,200,2,165 - db 20,197,20,240,252,169 -l2runl db 162,141,224,2,169 -l2runh db 4,141,225,2,173,56,96 - db 169,4,141,227,2,72,169,162,141,226,2,72,162,251,149,72,232,134 - db 67,238,220,4,16,32,238,10,3,208,3,238,11,3,169,255,141,1 - db 211,78,14,212,88,32,83,228,48,208,120,238,14,212,206,1,211,14 - db 220,4,173,127,4,166,67,208,207,129,68,230,68,208,2,230,69,165 - db 70,197,68,165,71,229,69,176,194,169,3,141,15,210,108,226,2,53 - db 46,48,112 - -; Ending Header for loader #2 -endseq2 db 250,4,250,4,224 - -exitcod dw 4c00h -flags db 0 -len dd lodlen+endlen -onam dw obxnam -anam dw atrnam -enam: -fhand dw ? -ohand dw ? -ahand dw ? -ofna dw ? -spt dw ? - -obxnam db 100h dup(?) -atrnam db 100h dup(?) - -f32 finddata32 ? - -head dw ?,? -blok db blen dup(?) - - ENDS - END start \ No newline at end of file diff --git a/xhead.asm b/xhead.asm deleted file mode 100644 index 205b77c..0000000 --- a/xhead.asm +++ /dev/null @@ -1,152 +0,0 @@ - IDEAL - P386 - MODEL TINY - CODESEG - ORG 100h - include 'fox.mak' - -smartio = 1 - -start: print hello - mov di, 81h - movzx cx, [di-1] - jcxz usg - mov al, ' ' - repe scasb - je usg - push cx di - dec di - inc cx - mov al, '?' - repne scasb - pop di cx - jne nousg - -usg: mov dx, offset usgtxt -panic: print - int 20h - - smartdisk - -read: mov cx, 2 - fread addr - cmp ax, 2 - mov ax, [addr] - ret - -nousg: lea dx, [di-1] - mov al, ' ' - repne scasb - jne okend - dec di -okend: mov si, di - mov cx, di - sub cx, dx -adex1: dec si - cmp [byte si], '.' - je adexn - cmp [byte si], '\' - loopne adex1 -adex2: mov eax, 'XBO.' - stosd -adexn: mov [byte di], 0 - fopen - - call read - mov dx, offset notbin - inc ax - jnz panic - -head1: inc [mods] - call read - jb eof - cmp ax, 0ffffh - je head1 - - inc [blox] - dec [mods] - mov [begn], ax - mov dl, ' ' - dos 2 - mov ax, [begn] - call prword - mov dl, '-' - dos 2 - - call read - mov dx, ax - sub dx, [begn] - inc dx - call prword - cmp dx, 2 - jne skip - cmp [begn], 2e0h - je pexec - cmp [begn], 2e2h - jne skip - inc [inits] -pexec: mov dl, ' ' - dos 2 - call read - call prword - jmp heade - -skip: xor cx, cx - file 4201h -heade: PEOL - jmp head1 - -eof: xor cx, cx - xor dx, dx - file 4202h - push ax - mov al, dl - call pbyte - pop ax - call prword - print byttxt - mov ax, [blox] - call prword - print blotxt - mov ax, [inits] - call prword - print initxt - mov ax, [mods] - call prword - print modtxt - fclose - ret - -prword: push ax - mov al, ah - call pbyte - pop ax -pbyte: ror ax, 4 - and al, 0fh - call pdig - shr ax, 12 -pdig: d2a - pusha - sta dx - dos 2 - popa - ret - -hello db 'X-HEAD 1.1 by Fox/Taquart',eot -usgtxt db 'Syntax: XHEAD obxfile',eot -notbin db 'File is not an Atari executable!',eot - smarterr -byttxt db ' bytes',eot -blotxt db ' blocks',eot -initxt db ' inits',eot -modtxt db ' modules',eot - -blox dw 0 -inits dw 0 -mods dw 0 - -addr dw ? -begn dw ? - - ENDS - END start \ No newline at end of file diff --git a/xload.asm b/xload.asm deleted file mode 100644 index c74198f..0000000 --- a/xload.asm +++ /dev/null @@ -1,452 +0,0 @@ - IDEAL - P386 - MODEL TINY - CODESEG -zero db 100h dup(?) - -ratio equ 671/1000 -timeAnswer = 2500*ratio -timeChecksum = 1500*ratio -timeSending = 600*ratio -timeNormal = 900*ratio -timeBefore = 1500*ratio -timeBetween = 600*ratio -timeUltra = 310*ratio - -eol equ 13,10 -eot equ 13,10,'$' - -MACRO lda _rg ;shorter than 'mov (e)ax, _rg' -_rge SUBSTR <_rg>, 1, 1 -IFIDNI _rge, - xchg eax, _rg -ELSE - xchg ax, _rg -ENDIF - ENDM - -MACRO sta _rg ;shorter than 'mov _rg, (e)ax' -_rge SUBSTR <_rg>, 1, 1 -IFIDNI _rge, - xchg _rg, eax -ELSE - xchg _rg, ax -ENDIF - ENDM - -MACRO dos _func -IFNB <_func> -IF _func and 0ff00h - mov ax, _func -ELSE - mov ah, _func -ENDIF -ENDIF - int 21h - ENDM - -MACRO file _func -IFNB <_func> -IF _func and 0ff00h - mov ax, _func -ELSE - mov ah, _func -ENDIF -ENDIF - call xdisk - ENDM - -MACRO fread _fbufr - mov dx, offset _fbufr - call xread - ENDM - -MACRO print _text -IFNB <_text> - mov dx, offset _text -ENDIF - dos 9 - ENDM - - -start: - db 1536 dup(0) ;compack - print hello - - mov si, 81h - mov di, offset obxnam - -arg1: lodsb - cmp al, ' ' - je arg1 - cmp al, '/' - jne nswit - lodsb - cmp al, '4' - ja ndigt - sub al, '1' - jb usg - mov [byte port], al - jmp arg1 -ndigt: and al, 0dfh - cmp al, 'P' - jne usg - mov [prof], al - jmp arg1 -nswit: cmp al, 0dh - je argx - cmp di, offset obxnam - ja usg -mnam1: stosb - lodsb - cmp al, ' ' - je mnam2 - cmp al, '/' - je mnam2 - cmp al, 0dh - jne mnam1 -mnam2: dec si - mov bx, di - lea cx, [di+zero-obxnam] -adex1: dec bx - cmp [byte bx], '.' - je adexn - cmp [byte bx], '\' - loopne adex1 - mov eax, 'XBO.' - stosd -adexn: mov [byte di], 0 - jmp arg1 - -usg: print usgtxt - dos 4c03h - -noport: mov dx, offset nocom - jmp panic -nobin: mov dx, offset e_nota - jmp panic - -xdisk: push bp - dos - pop dx - jnc xdret -panic: print - dos 4c02h - -xread: mov bp, offset e_read - file 3fh - cmp ax, cx -xdret: ret - -argx: cmp di, offset obxnam - jbe usg - mov bx, [port] - add [comnum1], bl - add [comnum2], bl - add bx, bx - push ds - push 40h - pop ds - mov cx, [bx] - pop ds - jcxz noport - mov [port], cx - - mov dx, offset obxnam - mov bp, offset e_open - file 3d00h ; open for reading - sta bx - mov cx, 2 - fread dcb - cmp [word dcb], 0ffffh - jne nobin - - mov dx, [port] - mov al, 3 - add dl, al - out dx, al - and dl, 0feh - xor al, al - out dx, al - - print rboot - - mov dx, [port] - mov cx, 6 - call speed - and dl, 0f8h - mov al, 5 - out dx, al - in al, dx - - mov di, offset dcb - -main: mov dx, [port] - in al, 60h - cmp al, 1 ; ESC key - je byebye - - add dl, 5 - in al, dx - test al, 1 - jz main - - and dl, 0f8h - in al, dx - mov [di+5], al - stosb - cmp di, offset dcb+5 - jb sk1 - mov di, offset dcb -sk1: cmp [byte di], 31h - jne main - - cmp [byte di+1], 'R' - je xcom_r - cmp [byte di+1], 'S' - jne main - -xcom_s: call ack - mov si, offset statdat - mov cx, 5 - call send - print booting - jmp main - -xcom_r: cmp [word di+2], 1 - jne main - call ack - mov si, offset bootstd - test [prof], 0ffh - jz sk3 - mov si, offset bootpro -sk3: mov cx, 129 - call send - call wate - - mov cx, 2 - call speed - mov [trtime], timeUltra - - test [prof], 0ffh - jz nodrom - call wtblok - mov si, offset bankdat - mov cx, 4 - call send -nodrom: - - call wtblok - -ffff: mov cx, 2 - fread head - jb kpliq - cmp [head], 0ffffh - je ffff - mov cx, 2 - fread head+2 - jb kpliq - shr [sdefrun], 1 - jnc nodefr - mov si, offset defrun - mov cx, 5 - call send - call wtblok -nodefr: mov di, offset hexnum - mov ax, [head] - call hexw - inc di - mov ax, [head+2] - call hexw - print loading - mov ax, [head] - dec ax - sub [head+2], ax - -dalej: mov ax, [head+2] - cmp ax, 100h - jbe sk2 - mov ax, 100h -sk2: sub [head+2], ax - sta cx - fread buf+3 - mov cx, ax - jcxz kpliq - mov si, offset buf - add ax, [head] - dec ah - xchg al, ah - mov [si], ax - mov al, cl - neg al - mov [si+2], al - add cx, 3 - call send - - inc [byte high head] - call wtblok - cmp [head+2], 0 - jnz dalej - jmp ffff - -kpliq: - mov si, offset runstd - test [prof], 0ffh - jz sk4 - mov si, offset runpro -sk4: mov cx, 4 - call send - - mov bp, offset e_read - file 3eh ; close file - print done -byebye: dos 4c00h - -wtblok: in al, 60h - cmp al, 1 - je byebye - and dl, 0f8h - add dl, 5 - in al, dx - test al, 1 - jz wtblok - and dl, 0f8h - in al, dx - mov si, offset bttime - jmp wate - -speed: and dl, 0f8h - add dl, 3 - in al, dx - push ax - or al, 80h - out dx, al - and dl, 0f8h - mov ax, cx - out dx, ax - add dl, 3 - pop ax - out dx, al - ret - -send: push si - mov si, offset trtime - call wate - pop si - mov dx, [port] - outsb - loop send - ret - -ack: mov si, offset ackdat - call wate - outsb - call wate - outsb -wate: in al, 61h - and al, 0fch - out 61h, al - mov ah, al - mov al, 0b0h - out 43h, al - lodsb - out 42h, al - lodsb - out 42h, al - mov al, 1 - or al, ah - out 61h, al - mov al, 080h - out 43h, al -wate1: in al, 42h - in al, 42h - cmp al, 255 - je wate1 -wate2: in al, 42h - in al, 42h - cmp al, 255 - jne wate2 - mov al, ah - out 61h, al - ret - -hexw: push ax - mov al, ah - call hexb - pop ax -hexb: aam 10h - cmp al, 10 - sbb al, 69h - das - xchg al, ah - cmp al, 10 - sbb al, 69h - das - stosw - ret - -ackdat: dw timeAnswer - db 'A' - dw timeChecksum - db 'A' - dw timeSending - -statdat db 098h,0FFh,001h,000h,099h - -bankdat db 0D2h,002h,0FFh,0FEh -runstd db 006h,060h,0FFh,0E0h -runpro db 003h,05Fh,0FFh,0E0h - -bootstd: - db 000h,001h,000h,007h,007h,007h,0A9h,060h,078h,0EEh,00Eh,0D4h,0A9h,008h,08Dh,004h - db 0D2h,0A9h,000h,08Dh,006h,0D2h,0A9h,028h,08Dh,008h,0D2h,08Dh,009h,0D2h,0A9h,023h - db 08Dh,00Fh,0D2h,08Dh,00Dh,0D2h,08Dh,00Ah,0D4h,00Ah,090h,0FAh,0A9h,013h,08Dh,00Fh - db 0D2h,0A0h,002h,020h,061h,007h,099h,04Ah,007h,0B9h,003h,007h,099h,0E1h,002h,048h - db 088h,0D0h,0F0h,020h,061h,007h,0AAh,020h,061h,007h,09Dh,000h,000h,0E8h,0D0h,0F7h - db 0A5h,010h,08Dh,00Eh,0D2h,0A9h,003h,08Dh,00Fh,0D2h,04Eh,00Eh,0D4h,058h,06Ch,0E2h - db 002h,0A9h,020h,08Dh,00Eh,0D2h,02Ch,00Eh,0D2h,0D0h,0FBh,08Ch,00Eh,0D2h,0ADh,00Dh - db 0D2h,060h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h - db 089h - dw timeBefore - -bootpro: - db 000h,001h,000h,004h,007h,004h,0A9h,060h,078h,0EEh,00Eh,0D4h,0EEh,000h,0D4h,0A9h - db 008h,08Dh,004h,0D2h,0A9h,000h,08Dh,006h,0D2h,0A9h,028h,08Dh,008h,0D2h,08Dh,009h - db 0D2h,0A9h,023h,08Dh,00Fh,0D2h,08Dh,00Dh,0D2h,08Dh,00Ah,0D4h,00Ah,090h,0FAh,0A9h - db 013h,08Dh,00Fh,0D2h,0A0h,002h,020h,060h,004h,099h,04Dh,004h,0B9h,003h,004h,099h - db 0E1h,002h,048h,088h,0D0h,0F0h,020h,060h,004h,0AAh,020h,060h,004h,09Dh,000h,000h - db 0E8h,0D0h,0F7h,0A5h,010h,08Dh,00Eh,0D2h,0A9h,003h,08Dh,00Fh,0D2h,06Ch,0E2h,002h - db 0A9h,020h,08Dh,00Eh,0D2h,02Ch,00Eh,0D2h,0D0h,0FBh,08Ch,00Eh,0D2h,0ADh,00Dh,0D2h - db 060h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h - db 0AEh - dw timeBefore - -hello db 'X-LOAD 1.1 by Fox/Taquart',eot -usgtxt db 'Syntax: XLOAD obxfile [options]',eol - db '/1 - /4 Specify COM port (default COM2)',eol - db '/p Professional loader',eot -nocom db 'COM' -comnum1 db '1 not found!',eot -rboot db 'Ready for booting Atari at COM' -comnum2 db '1...',eot -booting db 'Booting...',eot -loading db 'Loading ' -hexnum db ' - ',eot -done db 'Done.',eot -e_nota db 'ERROR: Not Atari executable',eot -e_open db 'ERROR: Can''t open file',eot -e_read db 'ERROR: Disk read error',eot - -prof db 0 -sdefrun db 1 ; send default run address -port dw 1 -trtime dw timeNormal -bttime dw timeBetween -dcb db 5 dup(0),5 dup(?) -defrun db 1,0e2h,0feh ; head is next !!! -head dw ?,? -buf db 103h dup(?) -obxnam: - - ENDS - END start \ No newline at end of file diff --git a/xloadcnv.asm b/xloadcnv.asm deleted file mode 100644 index 0c7a76f..0000000 --- a/xloadcnv.asm +++ /dev/null @@ -1,92 +0,0 @@ - IDEAL - P386 - MODEL TINY - CODESEG - ORG 100h - include 'fox.mak' - -start: mov [csum], 0 - fopen inpfile - mov [ihand], bx - fcreate outfile - mov [ohand], bx - - mov cx, 8 -main: push cx - mov bx, [ihand] - mov cx, 16 - fread buf - - mov si, offset buf - mov di, offset data - mov cx, 16 - jmp c0 -c1: mov al, ',' - stosb -c0: mov al, '0' - stosb - mov al, [si] - add [csum], al - adc [csum], 0 - shr al, 4 - d2a - stosb - lodsb - and al, 0fh - d2a - stosb - mov al, 'h' - stosb - loop c1 - mov ax, 0a0dh - stosw - - mov bx, [ohand] - mov cx, 85 - fwrite line - - pop cx - loop main - - mov bx, [ihand] - fclose - mov bx, [ohand] - mov di, offset data+1 - mov al, [csum] - shr al, 4 - d2a - stosb - mov al, [csum] - and al, 0fh - d2a - stosb - mov al, 'h' - stosb - mov ax, 0a0dh - stosw - mov cx, 10 - fwrite line - fclose - - mov eax, '.orp' - cmp eax, [dword typ1] - je wroc - mov [dword typ1], eax - mov [dword typ2], eax - jmp start -wroc: ret - -inpfile db '\atari\xasm\xload' -typ1 db 'std.obx',0 -outfile db 'xload' -typ2 db 'std.db',0 - -line db ' db ' -data db 81 dup(?) -ihand dw ? -ohand dw ? -buf db 16 dup(?) -csum db ? - - ENDS - END start \ No newline at end of file