import: snasm assembler, and a .bat to help me remember to run it.

This commit is contained in:
JASON-6700K\jandersen 2023-07-10 20:29:46 -04:00
parent 9a8848f415
commit 4dc8723dd0
35 changed files with 1423 additions and 0 deletions

1
bin/snasm/CFG.BAT Normal file
View File

@ -0,0 +1 @@
copy \asm\snbug658.cfg snbug658.cf7

1
bin/snasm/CFGORIG.BAT Normal file
View File

@ -0,0 +1 @@
copy \asm\snbug658.cfg snbug658.cf7

6
bin/snasm/DIPS.TXT Normal file
View File

@ -0,0 +1,6 @@
Regular dip switch settings (Snasm 1)
-------------------------------------
A - all down except 5,6,7
B - 1,2,3 up, all rest down

39
bin/snasm/EXAMPLE.658 Normal file
View File

@ -0,0 +1,39 @@
B0 group org($08000)
Break group org($0FFE6)
org 0
section s1,b0
regs pc=*,p=%00000100,s=$1ff,d=$5678,db=$00
mx %11
TrapEntry equ $708008
BreakEntry equ $70800B
assume db:$00
rep %00110000
MainLoop jsl TrapEntry ; service debugger
lda #100
jsr Delay
bra MainLoop
Delay module
dea
bne Delay
rts
modend
DoBrk jmp >BreakEntry
section s3,Break
dw DoBRK


15
bin/snasm/EXAMPLE.PRJ Normal file
View File

@ -0,0 +1,15 @@
[snmake]
t7:; example.658
snasm658 $! example.658,t7:,example.sym
!ifdef(DebugStr)
snbug658 example.sym
!endif
[eval]
snbug658 /v$$$ example.sym
[debug]
snbug658 example.sym

BIN
bin/snasm/EXAMPLE.SYM Normal file

Binary file not shown.

65
bin/snasm/GRAB16MB.GRB Normal file
View File

@ -0,0 +1,65 @@
!demo.bin
8000 to 10000
18000 to 20000
28000 to 30000
38000 to 40000
48000 to 50000
58000 to 60000
68000 to 70000
78000 to 80000
88000 to 90000
98000 to A0000
A8000 to B0000
B8000 to C0000
C8000 to D0000
D8000 to E0000
E8000 to F0000
F8000 to 100000
108000 to 110000
118000 to 120000
128000 to 130000
138000 to 140000
148000 to 150000
158000 to 160000
168000 to 170000
178000 to 180000
188000 to 190000
198000 to 1A0000
1A8000 to 1B0000
1B8000 to 1C0000
1C8000 to 1D0000
1D8000 to 1E0000
1E8000 to 1F0000
1F8000 to 200000
208000 to 210000
218000 to 220000
228000 to 230000
238000 to 240000
248000 to 250000
258000 to 260000
268000 to 270000
278000 to 280000
288000 to 290000
298000 to 2A0000
2A8000 to 2B0000
2B8000 to 2C0000
2C8000 to 2D0000
2D8000 to 2E0000
2E8000 to 2F0000
2F8000 to 300000
308000 to 310000
318000 to 320000
328000 to 330000
338000 to 340000
348000 to 350000
358000 to 360000
368000 to 370000
378000 to 380000
388000 to 390000
398000 to 3A0000
3A8000 to 3B0000
3B8000 to 3C0000
3C8000 to 3D0000
3D8000 to 3E0000
3E8000 to 3F0000
3F8000 to 400000

17
bin/snasm/GRAB4MB.GRB Normal file
View File

@ -0,0 +1,17 @@
!demo.bin
8000 to 10000
18000 to 20000
28000 to 30000
38000 to 40000
48000 to 50000
58000 to 60000
68000 to 70000
78000 to 80000
88000 to 90000
98000 to A0000
A8000 to B0000
B8000 to C0000
C8000 to D0000
D8000 to E0000
E8000 to F0000
F8000 to 100000

34
bin/snasm/GRAB8MB.GRB Normal file
View File

@ -0,0 +1,34 @@
!demo.bin
8000 to 10000
18000 to 20000
28000 to 30000
38000 to 40000
48000 to 50000
58000 to 60000
68000 to 70000
78000 to 80000
88000 to 90000
98000 to A0000
A8000 to B0000
B8000 to C0000
C8000 to D0000
D8000 to E0000
E8000 to F0000
F8000 to 100000
108000 to 110000
118000 to 120000
128000 to 130000
138000 to 140000
148000 to 150000
158000 to 160000
168000 to 170000
178000 to 180000
188000 to 190000
198000 to 1A0000
1A8000 to 1B0000
1B8000 to 1C0000
1C8000 to 1D0000
1D8000 to 1E0000
1E8000 to 1F0000
1F8000 to 200000

BIN
bin/snasm/INSTALL.EXE Normal file

Binary file not shown.

BIN
bin/snasm/LTU.EXE Normal file

Binary file not shown.

729
bin/snasm/NEW658.DOC Normal file
View File

@ -0,0 +1,729 @@
This file contains engineering notes on the versions of SNASM on this disk.
The notes on older versions are also included for people who may have missed
a release. Please note that we don't usually supply the latest version of
the software with new systems so you may want to update even if you have
only just get your system.
This information is incorporated into the manual each time we do a reprint
so much of this may already be in your current manual.
*****************************************************************************
SNASM658 1.24
SNBUG658 1.63
SNLINK 1.23
SNLIB 1.10
SCSILINK 1.5
. a bug that made snasm658 fail to recognise labels with direct page
optimisation switched on has been fixed.
*****************************************************************************
SNASM658 1.23
SNBUG658 1.63
SNLINK 1.23
SNLIB 1.10
SCSILINK 1.5
. a bug that prevented data being defined outside of any section has
been fixed in snasm658
. The linker could only output a maximum of 13 files when using
the group 'file' option. This limit has now been eradicated.
*****************************************************************************
SNASM658 1.22
SNBUG658 1.63
SNLINK 1.21
SNLIB 1.10
SCSILINK 1.5
. a bug in snasm658's memory allocation that caused a crash at the
start of pass two in low memory conditions if more that 300K of
code was being assembled has been fixed.
. a bug in snasm658 that could cause the linker to run wild if data
space was allocated outside any section/group has been fixed.
*****************************************************************************
SNASM658 1.21
SNBUG658 1.63
SNLINK 1.21
SNLIB 1.10
SCSILINK 1.5
. a bug in snlib that left XDEF'd symbols in object files produced
by snasm658 'unseen' has been fixed.
. a number of small improvments have been made to the file window and
file handling in snbug658. The only one noticable to the user is that
the full pathname of the file on display is now shown along the top
of the window.
*****************************************************************************
SNASM658 1.21
SNBUG658 1.57
SNLINK 1.21
SNLIB 1.09
SCSILINK 1.5
. groupend() and sectend() functions have been implemented in snasm658.
These give the end address of a group or section respectively. These
addresses are not evaluated until link time thus
#groupend(g1)-grouporg(g1)
gives the final size of group g1
*****************************************************************************
SNASM658 1.20
SNBUG658 1.57
SNLINK 1.21
SNLIB 1.09
SCSILINK 1.5
. Bug that prevented macro expansion inside short macros has been
fixed
*****************************************************************************
SNASM658 1.19
SNBUG658 1.57
SNLINK 1.21
SNLIB 1.09
SCSILINK 1.5
. Bug that crashed PC whilst stepping in the debugger has been fixed.
*****************************************************************************
SNASM658 1.19
SNBUG658 1.53
SNLINK 1.21
SNLIB 1.09
SCSILINK 1.5
. Fixed __mx in assembler
. Debugger now displays sizes of accumulator and index registers
. Various fixes to assembler and debugger
*****************************************************************************
SNASM658 1.18
SNBUG658 1.47
SNLINK 1.21
SNLIB 1.09
SCSILINK 1.5
. The assembler and linker now utilise all free memory on the
system, including UMB's on DOS 5+ and up to 64k of EMS if
available.
. The functions sectsize() and groupsize(); which return the
current size of a section or group respectively, have been
added. They are evaluated immediately and so reflect the
current section size at the point they are used, not the final
size.
. A bug that caused byte alignment when attempting to word
align a section has been fixed.
. The linker version number has also been bumped due to added
support for 68000 C cross-compilers.
. The debugger has some significant bug fixes and can now dump
the active window to the printer.
1. Multiple target support will now handle switching targets
during the Abort/Retry ... phase.
2. Problems with displaying memory at the end of bank $08 have
been fixed.
3. Indirection in debugger expressions now defaults to being
unsigned so that expressions such as 7e0000+[ptr] are evaluated
correctly when [ptr] > $8000
4. Effective address display will now conform to the way the
65816 works. Thus
lda $ffff,x
where db = $7e
x = $1
now resolves to $7f0000 NOT $7e0000.
5. A bug in running to cursor where the cursor resides on a
breakpoint is now fixed.
6. Locking a window whilst it is in disassembly mode and then
changing to a hex display no longer crashes the debugger.
7. Alt-P will dump a copy of the active window to the printer.
. Snlib has had its version number bumped because of additions
to its support for 68000 C cross compilers.
*****************************************************************************
SNASM658 1.17
SNBUG658 1.42
SNLINK 1.19
SNLIB 1.08
SCSILINK 1.5
. The debugger file window has been re-written. There is little
difference to the user in the way it operates. Key assignments have
been altered so that Ctrl-S/Ctrl-R saves/restores registers in all
windows and Alt-S/Alt-N starts/resumes a search.
*****************************************************************************
SNASM658 1.17
SNBUG658 1.40
SNLINK 1.19
SNLIB 1.08
SCSILINK 1.5
. Fixed bug in debugger that 'lost' MX records in disassembly.
*****************************************************************************
SNASM658 1.17
SNBUG658 1.39
SNLINK 1.19
SNLIB 1.08
SCSILINK 1.5
. Fixed bug in assembler that crashed if more that 256 include files
used.
. Fixed bug in assembler that allowed infinite macro expansion.
. Fixed bug in assembler that 'lost count' of parenthesis.
. Un-step added to the debugger on Alt-F4/Alt-F7
. Functions added to linker to support object file conversion for
C 68000 cross-compilers.
. Better detection of illegal addressing modes added to the assembler.
. option ow+/- has been added to the assembler to generate a warning
when absolute addressing has been assumed. This is designed to help
'update' code that was written when the assembler assumed long
absolute mode when it didn't know the operand value.
. Problems with scsilink and fast 486's fixed with the addition of
extra timeouts.
*****************************************************************************
SNASM658 1.13
SNBUG658 1.38
SNLINK 1.18
SNLIB 1.08
SCSILINK 1.4
. The linker has been profiled and many speed improvements have been
made.
. Linker now deletes the files created by the file() attribute on
groups if assembly fails.
. Problems in assembler caused by & continuation if white space (ws)
was enabled fixed.
. Errors in the inform statement don't no have their output appended
onto the inform output.
. You now don't need to define groups in your source code. Any
section that isn't placed in a group at assembly time can be assigned
to a group in the linker command file.
. Fixed problems with case sensitivity in debugger CLI.
. Fixed problems with debugger windows being left blank if a key was
pressed during loading with auto-update off.
. A new variable called __mx has been added which hold the current value
of the mx variable according to the assembler.
. Major changes to the way the assembler handles addressing modes.
See info. at end of this fix report. There are some changes in here
from the version 1.12 so everyone should have a read.
. Effective address display added to top of disassembly window.
. Extra code added to enable to debugger to 'sync' its disassembly
better.
. The debugger now understands the memory map of the console so labels
should be visible no matter what the DB reg holds.
Changes to addressing mode handling
-----------------------------------
65816 assembler :
The addressing mode stuff has been changed to conform with WDC spec.
There is now an optimisation option opt od-/+ which enables the
optimisation to direct page access to take place. Default is off.
opt t-/+ . When enabled truncates values in db/dw statements and immediate
operand values to the required size. Default is off.
opt ta+/-. When enabled truncates all address operands to the required size.
Default is on.
Immediate operands can specify the bytes of the operand to use as
in WDC spec, eg.
short accumulator long accumulator
lda #$12345678 -> lda #$78 lda #$5678
lda #<$12345678 -> lda #$78 lda #$5678
lda #>$12345678 -> lda #$56 lda #$3456
lda #^$12345678 -> lda #$34 lda #$1234
Absolute addressing modes can be forced, eg. :
lda <$12345678 -> lda $78 direct page
lda |$12345678 -> lda $5678 absoulte
lda >$12345678 -> lda $345678 long absoulte
Absoulte addressing modes should now behave as follows when no overiding
mode is specified :
(1) The address is evaluated.
(2) If direct page optimisation is on then the assembler will try
to convert to this mode.
(3) If (2) fails then the assembler will normally use absolute mode
unless it can determine that absolute long mode is necessary in
which case it will use that mode. It will no longer use long
absolute mode when it doesn't know the operand value.
Assumes :
In the following the operand value is known if (1) the operand can be
evaluated, (2) the operand is at a known offset from the start of an
org'd section, (3) the operand is at a known offset from the start
of a section which is known to be the first section in an org'd group
or (4) the operand is at a known offset from the start of the very
first section which will takes its base address from the first org
in the program.
if opt od+ is in effect then
(1) if d is not assumed then known operands in the range 0-255 will
be converted to direct page access.
(2) if d is assumed to a constant value then conversion to direct
access will take place when the operand value is 0-255 more than
that value.
(3) if d is assumed to a section then direct mode will be used if the
operand is known and is at an offset 0-255 from the start of that
section or if the operand is a symbol in that section.
(4) if d is assumed to a group then direct mode will be used if the
operand is known and is at an offset 0-255 from the start of that
group or if the operand is a symbol in that group.
Long absolute mode will be used when
(1) if db is not assumed and the operand value is known and greater
than $ffff.
(2) if db is assumed to a constant value and the operand value is
known and is less than that value or more than $ffff greater
than it unless it can be accessed by virtue of the mirroring
of ram & hardware registers in certain parts of the sfx memory map.
(3) if db is assumed to a section which is org'd and the operand value
is not in the same bank allowing for mirroring of ram and hardware
registers.
(4) if db is assumed to a group which is org'd and the operand value
is not in the same bank allowing for mirroring of ram and hardware
registers.
*****************************************************************************
SNASM658 1.10
SNBUG658 1.29
SNLINK 1.15
SNLIB 1.08
SCSILINK 1.4
. The jsr/jmp absolute instructions now get the bank information
correct so labels are always used correctly.
. Tracing problems in debugger are now definately fixed.
. Debugger CLI parsing has been rewritten as the multi-target support
introduced some problems. You shouldn't notice any changes so if you
do report it as a bug.
*****************************************************************************
SNASM658 1.10
SNBUG658 1.25
SNLINK 1.15
SNLIB 1.08
SCSILINK 1.4
. The assembler now allows question marks in labels.
. The l+/- option has been expanded to allow (almost) any character
to be used for a local label. You can specify any character here
but only a few will work without causing problems. The main one
this feature was added for was colon.
opt l: ; set local label char to colon
. The debugger had improved multi-target facilities. You can now
specify several targets on the command line and they can all
have seperate .cpe files and symbol tables. Unless you regularly
debug on two machine simultaniously you can ignore this option.
. More timeouts have been added to SCSILINK
. If the assembler can't evaluate the expression to which an equ
has been done it now substitutes the full expression where needed.
This means that you can equate something to an offset from an xref'd
symbol, equate something to an expression involving the pc when
linking etc.
. Grouporg function added which tells you the physical address at which
a group has been placed. This is mainly for use when you use the
obj directive on groups to find where the group is in memory to
allow it to be relocated.
. The < and > operators now have a very low priority so that
lda #<123+456
Gives the low byte of the full expression.
. A new option, B, has been added which swaps the meaning of < and >
when they are used as high/low byte operators
. The instructions rep, sep and cop now allow their operands to be
preceeded by a hash for compatability reasons.
. Ampersand (&) has been added as a general purpose line continuation
character. e.g.
MyMacro 1,2,3,4,&
5,6,7
This can be used at the end of any line except in the middle of
a string.
. You can now have a size on a short macro (i.e. mybcc.s)
. If you have sections in unnamed groups in your source you can
place them into groups in the linker command file. e.g.
In source
s1 section word
...
s2 section word
...
end
In linker command file
g1 group word
section s1,g1
section s2,g2
include source.obj
The group attributes *bss, word etc) must match the attributes of
the sections or an error will be raised.
*****************************************************************************
SNASM658 1.09
SNBUG658 1.23
SNLINK 1.13
SNLIB 1.06
SCSILINK 1.3
. Occasional problem tracing using snbug658 V1.19 fixed. Things seem
to check out now but contact us if there are any more problems.
. The linker now has a new switch /b which makes in link in 'big mode'.
This slightly increases link time (even a small disk cache will make
this inconsequential though) but allows very much more complex
projects to be linked.
*****************************************************************************
SNASM658 1.09
SNBUG658 1.19
SNLINK 1.12
SNLIB 1.06
SCSILINK 1.3
. The linker now allows groups to be orged to different addresses and
it also allows use of org ?size,type just like in the assembler.
Please note that only one ordinary org command should be used in the
linker command file and that this org will set the base address for
all groups that aren't orged seperately. The size parameter must be
a decimal or hex number as the object files have not been read by
this point to you will need to look at your map file to see how
much room to reserve for different groups.
. To go with DB and DW we have added DT and DL. These are for putting
down three byte and four byte constants. These were in version
1.08 but weren't documented.
. Assume can now be used to tell the assembler that a group is direct
addressable. Syntax is :-
DirectGroup group
assume d:DirectGroup
Any variables in this group will be accessed using the direct
addressing mode (if legal) as long as they are defined before they
are referenced.
*****************************************************************************
SNASM658 1.08
SNBUG658 1.16
SNLINK 1.11
SNLIB 1.06
SCSILINK 1.3
. The linker always used to be case sensitive but now it has a switch
in the same way as the assembler. To be compatible with the assembler
the linker now works case insensitive by default so you may need to
set a switch to maintain the status quo. Type snlink on its own
for an up to date list of linker switches.
. The assembler now reports the file/line where a structure was opened
if it isn't closed properly. This works for all of the structures
including modules and if's.
. The linker now stops if ESC is pressed whilst it is running. It
also tidies up open files if it is Ctrl-C'd.
. The assembler now writes the processor type into .obj files to
allow the linker to correctly handle regs commands. The linker
will give a warning if various .obj files were produced by different
assemblers but you are still free to do this. This has cured the bug
which occurred if you set the registers in a linker command file
when you were generating a .cpe file.
. To reduce the 'red tape' when you want just one section per group
you can now attach attributes to a section definition. Example -
Code section bss org($7E000)
This can be used whether or not you are linking. If you use this
feature you loose the ability to have several sections in the same
group.
. The type() function now returns zero if its argument isn't the
name of a symbol rather than giving an error. So type(Fred+3)
returns zero as opposed to giving an error.
. There is now another special macro
parameter \_. This returns the whole of the line following a
macro invocation from after the name of the macro until the end of
line or comment. This feature can be used when you are invoking a
macro from within a macro but as macros are stored without comments
the parts of the line after white space will have been removed.
. There were a few problems with forward referenced equates whilst in
link mode which have now all been fixed. These occurred when you did
something like :-
a equ b
b equ c
c
and the assembler had to evaluate the equs at the end of the first
pass.
. There is now no need to preceed a macro parameter with a backslash
when it is being used in an expression. You will still need the
backslash, and possible another at the end of the name, in all other
cases. For example -
fred macro x,y
dw x,y ; no backslash required
db 'X is \x and Y is \y' ; but is required here
db '123\x\456 ; both backslashes required
. The sect and offset functions now work correctly even when you are
linking i.e. sect(x)+offset(x) will always equal x. This means however
that neither sect nor offset can be evaluated until link time. If
you require the offset into the current modules contribution to a
section you will need to place a label at the start of the section
and do the subtract yourself.
. Partly in response to the above the alignment function has been added.
This tells you the offset from the section'ss alignment type (byte,
word or long) its argument is. In a byte aligned section alignment(x)
will always return 0, in a word aligned one it will return 0 or 1, and
in a long word aligned one 0 .. 3.
This function is usually used to check if the PC is odd or even as
in this example.
if alignment(*)&1
db 0 ; pad with a zero to word boundary
endif
*****************************************************************************
SNASM658 1.05
SNBUG658 1.16
SNLINK 1.09
SNLIB 1.05
SCSILINK 1.3
. Bug the caused branches to be reported out of range has been fixed
. As search has been added on Alt-S save and restore regs are now on
Ctrl-S and Ctrl-R
. SCSI errors in the debugger are auto-retried. If you abort you
get a chance to save the config file.
. The assembler now traps Ctrl-C and Ctrl-Break and exits gracefully.
. The @ operator has been added. It is used in expressions when you
need the value of the current PC.
Example
dw @,@,@ ; The three words will be 2 bytes apart.
dw Fred-@,Start-@ ; The offsets are from the current word.
The @ differs from the * in that * is the pc at the start of the line
whereas @ is advanced during the line.
. The debugger can now disassemble to file using Ctrl-D when in a
disassembly window. You are prompted for file name and range.
. Search has been added to the debugger on Alt-S. This works in
disassembly windows where you are prompted for instruction text to
search for, and in hex windows where you are prompted for a list
of values (or expressions) to search for. The search size (byte,word,
long) is decided by the current data size of the window (changed with
Alt-W). If you preceed the search expression with a double quote you
can search for ASCII text in a memory window.
. A bug that stopped F6 taking you around once more if the cursor was
at the current PC has been fixed.
. Update flag and interval are now saved in debugger config files.
. Aborting due to SCSI error now gives you the option of saving the
config file.
. Upload now verifies if you want to overwrite an existing file.
. The CLI option for label level now overrides the setting in the
config file. Update flag and interval work the same way.
. A bug in SCSILINK which occured for large send/receives which crossed
two 64k boundaries. This didn't affect any of the SNASM utilities as
they typically use 32K buffers which avoids the problem.
. Due to the large amount of work that has gone into the assembler and
linker, we have changed the version number in the OBJ files so you
will need to use all of the new tools as a set.
. A peculiarity with absolute indirect has been cleared up.
. A bug which caused some branches to be reported out of range has been
fixed.
. DCB and DCW now advance the PC correctly!
*****************************************************************************
SNASM658 1.03
SNBUG658 1.05
SNLINK 1.05
SNLIB 1.02
SCSILINK 1.2
. Bug when assembling
dcb 50000,$ff
has been fixed
. opt ws+/- switches between the 68000 and 65816 treatment of white
space in operands.
opt ws-
you then don't need to use a semi-colon to introduce a comment but
you can't write things like ...
lda #3 + 2
. Several new group attributes have been added.
Size Set maximum size of group. Warning if exceeded.
Obj Assemble whole group to run at different address.
File Write group to binary file. Now works in linker.
Over Put two or more groups on top of each other for overlays.
See section on new linker command file format for more info.
. Assembler no longer insists on an org statement. It is now back as
before so the manual examples will work again!
. Debugger now does an auto-retry after 1/2 second when it gets a
SCSI error.
. Problems with multiple file windows have been fixed.
. Linker has a totally new command file syntax as below.
; Comment
include filename Specify object file to read.
Can be in quotes. Default extension .obj
incbin filename Specify library file to search.
Can be in quotes. Default extension .lib
org address Give org address of program. The ? stuff
works as before.
regs pc=value Give start address. This will soon work for
the other registers.
name equ value Equate a symbol
name group [bss,org(val),over(name),word,file("name"),obj(val),
size(val),bank(val)]
Define a group and attributes. Group order
is determined by order of group statements.
section name[,group] Define a section and state which group it
is in. Section ordering is determined by
order of section statements.
workspace address Move workspace if downloading. The workspace
command doesn't currently work with CPE
files but will in a future release.
Example
include sorter.obj
include output.obj
org 1024
regs pc=ProgStart
LowGroup group word
CodeGroup group
BssGroup group bss
section Data1,LowGroup
section Data2,LowGroup
section Code1,CodeGroup
section Code2,CodeGroup
section Tables,BssGroup
section Buffers,BssGroup
To clear up any confusion about group attributes.
If you aren't linking all attributes should be specified in the
assembler source.
If you are linking the only attribute you should use in the source
are word and bss. All the others should be specified in the linker
command file.


83
bin/snasm/READ.ME Normal file
View File

@ -0,0 +1,83 @@
Contents of the distribution disk:
==================================
\macros\snasm.cb |
\macros\snasm1.cb |Set of brief macros to give integrated use of snasm
\macros\snasm.cm |
\macros\snasm1.cm |
\macros\snmk0.mnu brief menu file
\snasm\scsilink.exe TSR required to connect to target machines
\snasm\snasm658.exe Snasm 65186 Macro Assembler
\snasm\snbug658.exe Snasm 65186 Remote Debugger
\snasm\snlib.exe Snasm Library Manager
\snasm\snlink.exe Snasm Linker
\snasm\ltu.exe Snasm Link Test Utility
\snasm\snmake.exe Snasm make utility
\snasm\sncopy.exe Snasm copy utility
\snasm\snbug658.cf7 Snbug658 config file
\install.exe A utility to install the SNASM system
Notes
=====
1. The SNASM directory contains a utility (LTU) for testing the SCSI
link. It has built-in help using LTU ?
2. The brief editor macros that interface SNASM to the editor have
been revised to work with the Cross Products make utility SnMake, and
hence provide a better working environment for the SNASM user. In
practical terms this means that within brief the dialogue-box interface
to SNASM has been completely scrapped and now relies on using SnMake
and its associated 'project files' for the setting up and executing of
external commands. Whilst this involves slightly more work in initial
setting-up it offers longer-term time savings and and much more
flexibility. Please see the SNASM manual for further details on the make
utility and its operation.
3. Version 1.50 of the Brief macros have a new feature not covered in the
manual. This is the 'Assemble this file' menu item - keyboard binding Ctrl-A.
This macro allows the user to assemble the file in the current buffer without
using a project file and SnMake. Upon selection the macro creates a window on
the editor screen containing something similar to the following :
Snasm658 /i/d filename
The /i switch is allways set - this makes Snasm create an information window
on the editor screen as it assembles.
The /d switch appears depending on the state of the Debug variable as set
from the SNASM menu.
The user can now type in the remainder of the command line they wish to issue
and this will be restored when the macro is used later.
4. Version 1.51 of the Brief macros now pass control of error reporting on
to Brief's built in error handling if the SNASM project macros have not been
used to do an assembly\compile. This allows fuller use of Briefs built in
assembler\compiler support.
5. Version 1.24 of SnMake now has a facility to swap itself out of memory if
the user is experiencing memory shortages during an assembly. The syntax is
follows the normal project file command format with an addition as follows :
-mxxx snasm658 $! test1.658,t7:
where xxx is the memory threshold (in K) at which the make utility
should swap out. Thus -m500 will force the make utility to swap
itself out of memory if less than 500k of memory is available. -m640
will always cause a swap.
The swapping is done to extended memory by default, if none is available
expanded memory is looked for. Failure to find either extended or expanded
memory will force SnMake to swap itself to disk; by default the current
directory is used. This can be altered, for example to use a ram disk, in the
following manner :
swapdir=e:
which will force the make utility to swap to e: if it can find no available
'high' memory.NOTE - swapdir should be specified only once in a given
project file.

164
bin/snasm/RECORD.68K Normal file
View File

@ -0,0 +1,164 @@
; Some rather complex macros to add strucures (sort of) to your assembly
; language programs. (Needs SNASM >=0.21)
; This is presented as a starting point for discussion rather than a working
; and useable piece of code
; It may take you a while to figure out how these macros work but it is worth
; the effort!
; Run through the field array of Type and define all the offsets from Name
Define macro Name,Type
local TagNum,Temp
TagNum = 0
\Name equ *
rept \Type\_Count
Temp equs \Type\_\#TagNum
\Name\_\Temp equ \Name+\Type\_\Temp
TagNum = TagNum+1
endr
ds.b \Type\_Size
endm
; Initialise a field array
Record macro Name
_RecName equs '\Name'
_RecCount = 0
rsreset
endm
; Add a name to the current field array
NewName macro Name
\_RecName\_\#_RecCount equs '\Name'
_RecCount = _RecCount+1
endm
; Terminate field array
Recend macro
\_RecName\_Size equ __RS
\_RecName\_Count equ _RecCount
endm
; Add either a simple type or a structure to the current field array
RI macro Name,Field
local TagNum,Temp,Base
; Check for simple types
if strcmp('\Field','byte')
\_RecName\_\Name rs.b 1
NewName \Name
elseif strcmp('\Field','word')
\_RecName\_\Name rs.b 2
NewName \Name
elseif strcmp('\Field','long')
\_RecName\_\Name rs.b 4
NewName \Name
else
; It's a structure so run through field array adding new names
\_RecName\_\Name equ __RS
NewName \Name
TagNum = 0
Base = __RS
rept \Field\_Count
Temp equs \Field\_\#TagNum
\_RecName\_\Name\_\Temp equ Base+\Field\_\Temp
NewName \Name\_\Temp
TagNum = TagNum+1
endr
rs.b \Field\_Size
endif
endm
; Now define some structures
Record Point
RI X,word
RI Y,word
Recend
Record Rectangle
RI P1,Point
RI P2,Point
Ri Colour,word
Recend
; now use them
org $1000
Define Fred,Rectangle
list
; so I can now do
move.w #4,Fred_P1_X
lea Fred_P1(pc),a0
add.w #4,Point_X(a0)
; and
lea Fred,a0
move.w #12,Rectangle_P1_X(a0)
lea Rectangle_P1(a0),a1 ;a1 points at point 1 in fred
move.w Point_X(a1),d0
end
; I would of course prefer something like :-
move.w #4,Fred->P1->X
lea Fred->P1(pc),a0
add.w #4,Point->X(a0)
; any ideas on a nice syntax for these structures or does everyone hate them?

BIN
bin/snasm/SCSIL16.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SCSIL2.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SCSILINK.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SN659110.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNASM125.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNASM658.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNASM659.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNASMSPC.EXE Normal file

Binary file not shown.

26
bin/snasm/SNBUG658.CF7 Normal file
View File

@ -0,0 +1,26 @@
#readram
00000000 00FFFFFF
#writeram
00000000 00FFFFFF
#update
00 0000
#video
54 84 2B
#label level
02 7F 7F
#colour attributes
1E 17 1F F1 E1 30 B1 14 1C 70 E1 1C 1A 00 00 00
#mono attributes
0F 07 0F 70 70 07 70 0F 09 70 01 07 0F 07 0F 0F
#window
01 00 00
00 00 83 06 0A 01
00000000
#window
02 00 00
00 06 41 29 0A 07
00008000
#window
83 00 00
41 06 83 29 49 07
00008000

26
bin/snasm/SNBUG658.CFG Normal file
View File

@ -0,0 +1,26 @@
#readram
00000000 00FFFFFF
#writeram
00000000 00FFFFFF
#update
00 0000
#video
54 84 2B
#label level
02 7F 7F
#colour attributes
1E 17 1F F1 E1 30 B1 14 1C 70 E1 1C 1A 00 00 00
#mono attributes
0F 07 0F 70 70 07 70 0F 09 70 01 07 0F 07 0F 0F
#window
01 00 00
00 00 83 06 0A 01
00000000
#window
02 00 00
00 06 41 29 0A 07
00008000
#window
83 00 00
41 06 83 29 49 07
00008000

BIN
bin/snasm/SNBUG658.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNCOPY.EXE Normal file

Binary file not shown.

89
bin/snasm/SNGRAB.DOC Normal file
View File

@ -0,0 +1,89 @@
SNGRAB.
SnGrab is a SNASM utility designed to 'grab' the contents of memory from a
target machine and store it in a specified file(s) on the parent PC. SnGrab
can then download from the specified file(s) to the target machine at a
later date.
SnGrab is used as follows:
sngrab [/t - target num] +|- inputfile
where :
target is the SCSI ID of the active target (default 7)
+|- indicate the direction of data transfer - '+' = to the target
'-' = from the target
inputfile contains filenames to read\write and their corresponding
memory areas
The following example of an 'inputfile' is designed to upload the contents
of the lowest 512K of memory on a SNES into the files r:\demo1-16.
!r:\demo1.bin
8000 to 10000
!r:\demo2.bin
18000 to 20000
!r:\demo3.bin
28000 to 30000
!r:\demo4.bin
38000 to 40000
!r:\demo5.bin
48000 to 50000
!r:\demo6.bin
58000 to 60000
!r:\demo7.bin
68000 to 70000
!r:\demo8.bin
78000 to 80000
!r:\demo9.bin
88000 to 90000
!r:\demo10.bin
98000 to A0000
!r:\demo11.bin
A8000 to B0000
!r:\demo12.bin
B8000 to C0000
!r:\demo13.bin
C8000 to D0000
!r:\demo14.bin
D8000 to E0000
!r:\demo15.bin
E8000 to F0000
!r:\demo16.bin
F8000 to 100000
The following would load the same memory areas into one file;demo.bin.
!demo.bin
8000 to 10000
18000 to 20000
28000 to 30000
38000 to 40000
48000 to 50000
58000 to 60000
68000 to 70000
78000 to 80000
88000 to 90000
98000 to A0000
A8000 to B0000
B8000 to C0000
C8000 to D0000
D8000 to E0000
E8000 to F0000
F8000 to 100000
Assuming that the 'inputfile' is called demo.dat the following command line
will upload the memory from the target machine
sngrab - demo.dat
and the following will download from the PC to the target
sngrab + demo.dat

BIN
bin/snasm/SNGRAB.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNLIB.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNLINK.EXE Normal file

Binary file not shown.

BIN
bin/snasm/SNMAKE.EXE Normal file

Binary file not shown.

34
bin/snasm/SNRUN.DOC Normal file
View File

@ -0,0 +1,34 @@
SNRUN temporary documentation.
SNRUN is used to send a cpe file to a target machine and then start execution.
It can cope with cpe files produced by all versions of the assemblers and
linkers and copes with all embeded register and workspace information.
To get command line help type 'snrun ?'.
To send myfile.cpe to target 7 just type -
snrun myfile
To send myfile.cpe to target 6 but not start executing type -
snrun /h /t6 myfile
The following can be used in your .prj file if you want to work via a cpe
file.
...
demoag.cpe; demoag.68k
snasm68k $! demoag.68k,demoag.cpe,demoag.sym
!ifdef(debugstr)
snbug68k /edemoag.cpe demoag.sym
!else
snrun demoag
!endif
...
It returns error codes but I don't have a list of them yet!
Ian Oliver


BIN
bin/snasm/SNRUN.EXE Normal file

Binary file not shown.

93
bin/snasm/SPC700.DOC Normal file
View File

@ -0,0 +1,93 @@
64K address space.
0000-00FF Page zero
0100-01ff Page one (used for stack as on 6502)
Regs
A, X, Y PSW, (program status word), PC, SP
A is 8 bit. When using 16 bit instructions in is paired with Y, with Y
being the high order byte.
Boolean bit operations can be performed in the memory range 0000-1fff
Format of PSW.
NVP-H-ZC Negative, Overflow, Direct page, Half carry, Zero, Carry
The direct page flag determines if DP accesses are to page 0 or page 1.
Addressing modes
----------------
Mode Desc. Bytes
dp Direct page 2
dp+X X-indexed direct page 2
dp+Y Y-indexed direct page 2
(X) indirect 1
(X)+ indirect auto-inc 1
dp.dp Direct page to dp 3
(X),(Y) Indirect page to IP 1
dp,#imm Immediate data to dp 3
dp.bit Direct page bit 2
dp.bit.rel Direct page bit rel 3
mem.bit Absolute bit 3
!abs absolute 3
!abs+X absolute X 3
!abs+Y absolute Y 3
[dp+X] X-indexed indirect 2
[dp]+Y Indirect Y-indexed 2
Latest Changes to snasmspc
--------------------------
All instructions are now implemented including bbs, set1, etc.
The character between the memory location and the bit number in and1, etc.
is now '.' rather than ',', eg.
and1 c,$23.2
set1 $30.1
If the memory address ends in a name it will have to be bracketed to avoid
the bit number being treated as part of the name, eg.
and1 c,(fred).2
There is an assume statement for the direct page selection flag :
assume dp:0 -- page 0 is direct page
assume dp:1 -- page 1 is direct page
initially page 0 will be assumed to be direct page. Optimisation to
direct page addressing will check that the operand is in the assumed
page.
Absolute address mode can be forced by using ! as an operand prefix, eg.
mov !$30+y,a
jmp !fred
jmp [!jtab+x]
Direct page addressing can be forced by using < as an operand prefix, eg.
mov <fred,a
The address expression will be calculated by subtracting the currently
assumed direct page bank number from the operand value. The result of
this must be in the range 0-255.
The ` characters are used to enclose macro parameters (as in 65816), eg.
callmacro `fred < jim`


1
snasm.bat Normal file
View File

@ -0,0 +1 @@
bin\dosbox\dosbox.exe -conf bin\dosbox.config