Commit af218953 authored by ASCP's avatar ASCP 💬

Initial commit

parents
# Ignore the build and lib dirs
src/build
lib/*
# Ignore any executables
src/bin/*
# Ignore Mac specific files
.DS_Store
# Ignore FS-Uae files
*.uaem
# Ignore temp files
*.swp
# Ignore object files
*.o
# Changelog
All notable changes to this project will be documented in this file.
The format is based on http://keepachangelog.com/en/1.0.0/[Keep a Changelog]
and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioning].
## [3.9.1] - 2018-05-13
### Added
- NewStartup39.lha files
- Changelog, Readme, License
- Initial project
### Changed
- Project structure
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Full text: https://creativecommons.org/publicdomain/zero/1.0/
No Copyright
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.
You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. See Other Information below.
Other Information
* In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights.
* Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law.
* When using or citing the work, you should not imply endorsement by the author or the affirmer.
# NewStartup
**Description**: Enhanced startupcode for assembler.
Works with any kickstart, chip and configuration.
Should work with any assembler.
WHAT KIND OF USE?
* Checks processor and fpu if wanted. Allowing requirement for this.
* Run your program from WB and CLI.
* Opens and closes wanted libraries automatically!
* Dumps error messages on ALL errors (from 3.5+): too low processor,
no FPU, no library, debug info etc. and then exits gracefully.
* Parse any kind of arguments. Handles quotes, asterix' etc.
Returns null terminated extracted arguments.
* Set taskname easily.
* Just one include (itself). Need no external includes.
* Adds 11 macro commands to your assembler.
* Exit with the right return code.
* Educational source. Source fully documented.
* Source is public domain.
* Demo sources follows this archive.
**Technology stack**: 68k
**Project Status**: https://gitlab.com/amigasourcecodepreservation/newstartup/blob/master/CHANGELOG.adoc[CHANGELOG]
## Dependencies
* Amiga OS Classic
## Getting help
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.
## Getting involved
Contact your old amiga friends and tell them about our project, and ask them to dig out their source code or floppies and send them to us for preservation.
Clean up our hosted archives, and make the source code buildable with standard compilers like devpac, asmone, gcc 2.9x/Beppo 6.x, sas/c ,vbcc and friends.
Cheers!
....
_____ ___ _ __ __ _ __ __ ___ ___ _
|_ _| __| /_\ | \/ | /_\ | \/ |_ _/ __| /_\
| | | _| / _ \| |\/| | / _ \| |\/| || | (_ |/ _ \
_|_| |___/_/ \_\_|_ |_|_/_/_\_\_|__|_|___\___/_/_\_\
/ __|/ _ \| | | | _ \/ __| __| / __/ _ \| \| __|
\__ \ (_) | |_| | / (__| _| | (_| (_) | |) | _|
|___/\___/_\___/|_|_\\___|___|__\___\___/|___/|___|_
| _ \ _ \ __/ __| __| _ \ \ / /_\_ _|_ _/ _ \| \| |
| _/ / _|\__ \ _|| /\ V / _ \| | | | (_) | .` |
|_| |_|_\___|___/___|_|_\ \_/_/ \_\_| |___\___/|_|\_|
....
https://twitter.com/AmigaSourcePres[Twitter]
https://gitlab.com/amigasourcecodepreservation[Gitlab]
https://amigasourcepres.gitlab.io/[WWW]
## License
NewStartup is distributed under the terms of the Create Commons CC0 1.0 Universal License. See the https://gitlab.com/amigasourcecodepreservation/newstartup/LICENSE.md[LICENSE] file for details.
In other words - it is "public domain", but we appreciate if you send us any updates.
## Credits and references
Many thanks to Kenneth C. Nilsen for releasing the http://aminet.net/package/dev/asm/NewStartup39[project] into public domain
File added
This diff is collapsed.
Short: Enhanced startupcode for assembler v3.9
Author: Kenneth C. Nilsen (kenneth@norconnect.no)
Uploader: Kenneth C. Nilsen (kenneth@norconnect.no)
Type: dev/asm
Replaces: dev/asm/NewStartup*
Startup.asm
===========
$VER: Startup_asm 3.9 (06.10.96)
Copyright 1995,1996 by Kenneth C. Nilsen (kenneth@norconnect.no).
All rights reserved.
Currently the most powerful startup code you'll find for your assembler.
This source is public domain.
Works with any kickstart, chip and configuration.
Should work with any assembler.
WHAT KIND OF USE?
=================
* Checks processor and fpu if wanted. Allowing requirement for this.
* Run your program from WB and CLI.
* Opens and closes wanted libraries automatically!
* Dumps error messages on ALL errors (from 3.5+): too low processor,
no FPU, no library, debug info etc. and then exits gracefully.
* Parse any kind of arguments. Handles quotes, asterix' etc.
Returns null terminated extracted arguments.
* Set taskname easily.
* Just one include (itself). Need no external includes.
* Adds 11 macro commands to your assembler.
* Exit with the right return code.
* Educational source. Source fully documented.
* Source is public domain.
* Demo sources follows this archive.
NEW FEATURES
============
3.9:
- Added two macros:
InitDebugHandler "<filename>"
DebugDump "Debug text",labelID
Powerful debug tool to help you in your programming. The debug
macros can easily be activated or deactivated. If deactivated they
will not be assembled.
- Changed the CPU and MATH check. You now have to activate them the
same way as the debug procedure or the check will not be assembled.
This will save space in your programs if CPU/MATH check isn't
necessary.
File added
<>-----------------------------------<>
Startup Example binaries readme
<>-----------------------------------<>
In this directory you will find six files assembled with various settings.
You can get quite small files with minimal settings. If you choose to use
the debug feature you can see that the file size will increase dramatically.
The debug feature is meant for private use only so please remember to
deactivate this feature when publicing you binary files.
StartupExample_NONE 1280 bytes
StartupExample_CPUCHECK 1460 bytes
StartupExample_MATHCHECK 1380 bytes
StartupExample_CPUMATH 1556 bytes
StartupExample_DEBUG 2264 bytes
StartupExample_ALL 2540 bytes
The file StartupExample_NONE has no active settings.
The file StartupExample_CPUCHECK has these settings:
CpuCheck SET 1
Processor = 68020
The file StartupExample_MATHCHECK has these settings:
MathCheck SET 1
MathProc = 68881
The file StartupExample_CPUMATH has these settings:
CpuCheck SET 1
MathCheck SET 1
Processor = 68060
MathProc = 68882
The file StartupExample_DEBUG has this option set:
DODUMP SET 1
The file StartupExample_ALL has all options set:
CpuCheck SET 1
MathCheck SET 1
Processor = 68020
MathProc = 68881
DODUMP SET 1
The reason for the larger filesize is all the text DebugDump shall write to
the output handler (and some code). You don't need to remove the DebugDump
lines.. just comment out the DODUMP and all debug will be ignored when
assembled.
NOTE: Other options such as the SkipStart is always set. None of the other
macros necessary such as the DefEnd, are shown here.
For more information please consult the documentation following this archive.
- Kenneth C. Nilsen
File added
* MACROS for sources by Kenneth C. Nilsen / Digital Surface
OpenLib MACRO OpenLib Library,Version
lea \1N(pc),a1
moveq #\2,d0
jsr -552(a6)
move.l d0,\1B
ENDM
CloseLib MACRO CloseLib Library
move.l \1B(pc),d0
beq.b *+8
move.l d0,a1
jsr -414(a6)
ENDM
CloseWin Macro CloseWin <WinBase>
move.l \1(pc),d0
beq.b *+8
move.l d0,a0
jsr _LVOCloseWindow(a6)
EndM
CloseScr Macro CloseScr <ScrBase>
move.l \1(pc),d0
beq.b *+8
move.l d0,a0
jsr _LVOCloseScreen(a6)
EndM
Base MACRO Base LibN
move.l \1B(pc),a6
ENDM
ExecB MACRO move Execbase to a6
move.l $4.w,a6
ENDM
Pen MACRO
moveq #\1,d0
jsr -78(a6)
ENDM
StackOn MACRO
movem.l d2-d7/a2-a6,-(sp)
ENDM
StackOff MACRO
movem.l (sp)+,d2-d7/a2-a6
ENDM
SetPen MACRO SetPen Color
move.l a5,a1
moveq #\1,d0
jsr -342(a6)
ENDM
Box MACRO Box X1,Y1,X2,Y2
move.l a5,a1
move.l \1,d0
move.l \2,d1
move.l \3,d2
move.l \4,d3
jsr -306(a6)
ENDM
LineC MACRO LineC X1,Y1,X2,Y2,Color
move.l a5,a1
moveq #\5,d0
jsr -342(a6)
move.l a5,a1
move.l \1,d0
move.l \2,d1
jsr -240(a6)
move.l a5,a1
move.l \3,d0
move.l \4,d1
jsr -246(a6)
ENDM
Line MACRO Line X1,Y1,X2,Y2
move.l a5,a1
move.l \1,d0
move.l \2,d1
jsr -240(a6)
move.l a5,a1
move.l \3,d0
move.l \4,d1
jsr -246(a6)
ENDM
LineW MACRO LineW X1,Y1,X2,Y2
move.l a5,a1
move.w \1,d0
move.w \2,d1
jsr -240(a6)
move.l a5,a1
move.w \3,d0
move.w \4,d1
jsr -246(a6)
ENDM
DCall MACRO
jsr _LVODF\1(a6)
ENDM
Call MACRO
jsr _LVO\1(a6)
ENDM
PrtCmd MACRO
move.l #PRTCMD_\1,d0
; jsr LVODF_PrintComand(a6)
ENDM
;These macros will make BarFly sources compatible wih other assemblers:
MB MACRO
move.b \1,\2
ENDM
MW MACRO
move.w \1,\2
ENDM
ML MACRO
move.l \1,\2
ENDM
MQ MACRO
moveq \1,\2
ENDM
**
*
* 1996 by Kenneth C. Nilsen. E-Mail: kennecni@idgOnline.no
*
* Name
* Sample header version 2.0 with tutorial examples
*
* Function
* Shows example setup in source. Please read the docs for more
* information on how to use the macros.
*
* Inputs
*
*
* Notes
* Please remove any unwanted info and use this as your
* standard header.
*
* Bugs
*
* Created : 06.10.96
* Last change : 06.10.96
**
*## For the Startup.asm:
StartSkip = 1 ;0=WB/CLI, 1=CLI only (AsmOne)
;CpuCheck set 1 ;if these aren't defined the CPU or/
;MathCheck set 1 ;and math check will be ignored
Processor = 0 ;0/680x0/0x0
MathProc = 0 ;0/68881/68882/68040/68060
*## For the DUMPSTRING macro:
;DODUMP SET 1 ;define to activate DebugDump and
;InitDebugHandler else they will be
;ignored (not assembled)
*## Default includes:
Incdir inc:
Include Startup.asm
*## Version string to be looked for with C:Version :
dc.b "$VER: SampleHeader 1.0 (06.10.96)",10
dc.b "This header is PUBLIC DOMAIN",0
even
**
Init: TaskName "Test" ;use "<Test>" for DevPac/BarFly
DefLib dos,39 ;open dos.library version 39 (kick 3.0+)
DefEnd
Start: InitDebugHandler "CON:0/20/640/160/Debug Output/WAIT/CLOSE"
DebugDump "This is only assembled when DODUMP SET 1",0
NextArg
beq.b Close ;any arguments ?
LibBase dos ;use dos base
StartFrom ;check where we started from
beq.b Dos ;started from CLI
Dos:
**
Close Return 0
**
**
**
This diff is collapsed.
*****************************************************************************
* "Startup.asm"
*
* $VER: Startup_asm stripped version 3.9 (07.10.96)
*
* Copyright 1995,1996 by Kenneth C. Nilsen/Digital Surface
* This source is freely distributable.
*
* For instructions read the Startup_Asm.doc or the Startup_example.s
*
*****************************************************************************
zyxMax = 17 ;max no. of libraries
zyxBufZ = 308 ;format buffer size
Return: Macro
moveq #\1,d0
rts
EndM
DefLib: Macro
lea \1NamX(pc),a1
move.l a1,(a5)+
move.l a1,zyxNx
moveq #\2,d0 ;if you use ver >127, change this to "move.l"
move.l d0,(a5)+
move.l d0,zyxVx
jsr -552(a6)
move.l d0,(a5)+
move.l d0,\1basX
bne.b \1zyx
bsr.w zyxLibR
bra.b \1zyx
\1basX: dc.l 0
\1NamX: dc.b "\1.library",0
even
\1zyx:
EndM
DefEnd: Macro
move.l #-1,(a5)
rts
EndM
LibBase: Macro
move.l \1basX(pc),a6
EndM
TaskName: Macro
move.l $4.w,a6
jsr -132(a6)
move.l zyxTask(pc),a0
move.l #.TaskN,10(a0)
jsr -138(a6)
bra.b .zyxTsk
.TaskN: dc.b \1
dc.b 0
even
.zyxTsk:
EndM
TaskPri: Macro
move.l $4.w,a6
move.l zyxTask(pc),a1
moveq #\1,d0
jsr -300(a6)
EndM
TaskPointer: Macro
move.l zyxTask(pc),d0
EndM
StartFrom: Macro
move.l RtnMess(pc),d0
EndM
NextArg: Macro
move.l zyxArgP(pc),d0
beq.b *+8
move.l d0,a0
bsr.w zyxGArg
move.l a0,zyxArgP
tst.l d0
EndM
DebugDump MACRO
IFD DODUMP
StartDump\2:
movem.l d0-d7/a0-a6,-(sp)
move.l zyxDosBase(pc),a6
jsr -60(a6)
move.l d0,d1
bne.b .ok
move.l zyxHandle(pc),d1
beq.b .debEnd
.ok move.l #.string,d2
move.l #.stringSize,d3
jsr -48(a6)
bra.b .debEnd
.string dc.b "DEBUG DUMP: ",27,"[1m",\1,27,"[0m",10
.stringSize = *-.string
even
.debEnd movem.l (sp)+,d0-d7/a0-a6
EndDump\2:
ENDC
ENDM
InitDebugHandler: MACRO
IFD DODUMP
tst.l zyxHandle
bne.b .exit
move.l zyxDosBase(pc),a6
jsr -60(a6)
move.l d0,zyxHandle
bne.b .exit
st zyxDebugHand
move.l #.handle,d1
move.l #1006,d2
jsr -30(a6)
move.l d0,zyxHandle
bra.b .exit
.handle dc.b \1,0
even
.exit
ENDC
ENDM
Version: Macro ;obsolete!
NOP
EndM
GoZYX: move.l a0,-(sp)
move.l d0,zyxArgL
move.l a0,zyxArgP
move.l $4.w,a6
move.l a6,execbasX
move.l #zyxBufZ,d0
moveq #1,d1
jsr -198(a6)
move.l d0,zyxBuff
beq.w .DOS
lea zyxDos(pc),a1
moveq.l #0,d0
jsr -552(a6)
move.l d0,zyxDosBase
beq.w .DOS
sub.l a1,a1
jsr -294(a6)
move.l d0,a4
move.l d0,zyxTask
tst.l 172(a4)
bne.b .chkPro
moveq #StartSkip,d0
bne.b .chkPro
lea 92(a4),a0
jsr -384(a6)
lea 92(a4),a0
jsr -372(a6)
move.l d0,RtnMess
.chkPro:
move.w 296(a6),d5
IFD CPUCHECK
move.l #Processor,d7
beq.w .ProOk
cmp.w #60,d7
ble.w .nxPro1
sub.l #68000,d7
beq.w .ProOk
.nxPro1:
cmp.b #10,d7
bne.b .nxPro2
and.b #$cf,d5
bne.w .ProOk
bra.w .ProErr
.nxPro2:
cmp.b #20,d7
bne.b .nxPro3
and.b #$ce,d5
bne.w .ProOk
bra.b .ProErr
.nxPro3:
cmp.b #30,d7
bne.b .nxPro4
and.b #$cc,d5
bne.b .ProOk
bra.b .ProErr
.nxPro4:
cmp.b #40,d7
bne.b .nxPro5
and.b #$c8,d5
bne.b .ProOk
bra.b .ProErr
.nxPro5:
cmp.b #60,d7
bne.b .ProWho
btst #7,d5
beq.b .ProErr
btst #6,d5
bne.b .ProOk
bra.b .ProErr
.ProWho:
lea ProcWho(pc),a0
move.l #Processor,ProcNum
lea ProcNum(pc),a1
bsr.w zyxPrt
bra.w .End
.ProErr:
st zyxLR
lea ProcErr(pc),a0
add.l #68000,d7
move.l d7,ProcNum
lea ProcNum(pc),a1
bsr.w zyxPrt
ENDC
.ProOk: IFD MATHCHECK
move.l #MathProc,d7
beq.w .MathOk
sub.l #68000,d7
cmp.w #881,d7
bne.b .Math2
and.b #$70,d5
bne.b .MathOk
bra.b .MathEr
.Math2: cmp.w #882,d7
bne.b .Math3
and.b #$60,d5
bne.b .MathOk
bra.b .MathEr
.Math3: cmp.b #60,d7
beq.b .m60ok
cmp.b #40,d7
bne.b .MathEr
.m60ok btst #6,d5
bne.b .MathOk
.MathEr:
st zyxLR
lea ProcErr(pc),a0
move.l #MathProc,ProcNum
lea ProcNum(pc),a1
bsr.w zyxPrt