Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/themabus/pds-assembly-dox

Some examples of assembling with the prominent DOS cross-assembler from the 80s
https://github.com/themabus/pds-assembly-dox

6502 6502-assembly amstrad-cpc c64 famicom nes nintendo sega-master-system z80 z80-asm z80-assembly zx-spectrum

Last synced: 3 days ago
JSON representation

Some examples of assembling with the prominent DOS cross-assembler from the 80s

Awesome Lists containing this project

README

        

# PDS-Assembly-Dox
### CAUTION!
It appears that on some occasions an error message about insufficient __FILES__ in __CONFIG.SYS__ may appear,
when saving the files from PDS editor, resulting in the erasure of the content of those files.
So please don't even think about directly feeding it your original sources from unprotected floppies or something silly like that.


### Some examples, from easy to more finicky:
CPC __Dizzy 3__ (https://github.com/Wireframe-Magazine/Wireframe19)
- compile for __amstrad__ with __PDSZ80f.EXE__ to get __AA__ or with __PDSZ80c.EXE__ on __DOSBox-X__

to get serial output __ser2.bin__
- unpack it to __0bank0.bin__ with __pds2rom.exe aa__
- use __CaPriCe Forever__
- set breakpoint: __&0dfb__
- run __call &0dfb__ to activate BP
- memory editor/dump/import bin
- unpause debugger and it should execute from set PC

CPC __Lop Ears__ (https://spectrumcomputing.co.uk/forums/viewtopic.php?t=1932)
- compile with __PDSZ80f.EXE__ to get __AA__ or with __PDSZ80c.EXE__ on __DOSBox-X__ to get serial output __ser2.bin__
- unpack it to __0bank0.bin__ with __pds2rom.exe aa__
- trim it with __sfk partcopy 0bank0.bin -yes -allfrom 0x300 out.bin__
- use __CaPriCe Forever__
- set breakpoint: __&2328__
- run __call &2328__ to activate BP
- memory editor/dump/import bin
- set __From__ to __&300__ before importing
- unpause debugger and it should execute from set PC

ZX __Street Cred Football__ (https://spectrumcomputing.co.uk/forums/viewtopic.php?t=1932)
- compile with __PDSZ80f.EXE__ to get __AA__ or with __PDSZ80c.EXE__ on __DOSBox-X__ to get serial output __ser2.bin__
- unpack it to __0bank0.bin__ with __pds2rom.exe aa__
- trim it with __sfk partcopy 0bank0.bin -yes -allfrom 0x4000 out.bin__
- use __ZXSpin__
- Tools/Debugger set breakpoint: __#9472__ (as __38002__ is specified in X0 comments)
- run __randomize usr 38002__ to activate BP (T Ctrl+Shift L 38002)
- File/Load Binary
- set __Start__ to __#4000__ before importing
- unpause debugger and it should execute from set PC

C64 __Altered Beast Intro__ (https://github.com/milkeybabes?tab=repositories)
- compile x?.tap files with __PDS6502f.EXE__ to get __AA__ or with __PDS6502c.EXE__ on __DOSBox-X__

to get serial output __ser2.bin__
- unpack it to __0bank0.bin__ with __pds2rom.exe aa__
- prepend rom with 2 bytes and remove last 2: <- C64 emulator quirk

__sfk partcopy 0bank0.bin -yes -fromto 0 2 addr.bin__

__copy /b addr.bin +0bank0.bin out.bin__

__sfk partcopy out.bin -yes -fromto 0 0x10000 intro.prg__

(so if those 2 bytes happen to be meaningful, fill them from debugger later on)

- use __Z64K__
- Applications/Machine Monitor

__l "intro.prg" 0__

__g 9837__

- close Monitor and it should run

C64 __Alien 3__ (https://github.com/milkeybabes?tab=repositories)
- compile __EFFECTS.PDS__ with __PDS6502f.EXE__ to get __AA__ or with __PDS6502c.EXE__ on __DOSBox-X__

to get serial output __ser2.bin__
- process it as Intro above (with 2 extra zero bytes) and you should have __effects.prg__
- open 0-7.PDS in PDS and set __TAPE_LOADER__ to 0 and uncomment __START_CODE__ at the end of 7th window
- try to compile and get an error about a missing gfx file
- go to __SPRITES__ directory and copy __JUMP.SPR__ to __THROW.SPR__, __TUMBLE.SPR__ and __TURN.SPR__
- copy __JUMP.REV__ to __THROW.REV__, __TUMBLE.REV__ and __TURN.REV__
- now compile it and process output as __Altered Beast Intro__ or __EFFECTS.PDS__ into __alien3.prg__
- launch __Z64K__ and fire up Monitor

__l "alien3.prg" 0__

__g f300__

- notice assembler instructions dont make sense

this is because this memory space is mapped to Kernal so we first have to map this region to RAM

how upsetting, lets cheer ourselves up with some wicked beats

__l "effects.prg" 0__

__g 1791__

- close Monitor to launch effects sampler
- after you've cheered up proper, open Monitor again and __g f300__; notice it has removed Kernal for us
- __l "alien3.prg" 0__
- execute __g f300__ again to refresh the instruction window and you should see the familiar loader routine
- close Monitor and the game should run now

SMS __The Fantastic Adventures of Dizzy__ (https://spectrumcomputing.co.uk/forums/viewtopic.php?t=1932)

this game assembles with PDS/2 for Z80 __P2Z80.EXE__ which was kindly provided in the same archive

as the source code

- replace all instances of __C:\SEGA8BIT\BIGDIZZY\\__ in __FANTSEGA.PRJ__ with nothing, to get relative paths
- search for __incbin__ in source files and, like above, replace all __C:\SEGA8BIT\BIGDIZZY\\__ paths with nothing

this should affect 2 .dat files and 15 .inc files

- in __PAGE2.ROU__ change __D:\UTILS\FLEX\UNFLEX.Z80__ -> __UNFLEX.Z80__
- copy in __UNFLEX.Z80__ from the archive
- comment out __PATH__ string at the top of __MACROS.ROU__ and chabge __SEND COMPUTER1__ to __SEND SERIAL__
- the game should now compile, producing binary output from serial port in your __DOSBox-X__ directory

- close __DOSBox__ and move this file someplace else; it should be __259842__ bytes long

- now lets create an 64k FF filled file:

__sfk make-zero-file bank 0x10000__

__sfk rep bank -yes -binary /00000000/ffffffff/__

- unpack data:

__pds2rom.exe ser1.bin bank >log__

- trim garbage:

__sfk partcopy 0bank64.bin -yes -fromto 0x0000 0x4000 64.bin__

__sfk partcopy 0bank65.bin -yes -fromto 0x4000 0x8000 65.bin__

__sfk partcopy 0bank66.bin -yes -fromto 0x8000 0xc000 66.bin__

...

__sfk partcopy 0bank79.bin -yes -fromto 0x8000 0xc000 79.bin__

- join all banks:

__copy /b 64.bin +65.bin +66.bin +67.bin +68.bin +69.bin +70.bin +71.bin +72.bin +73.bin +74.bin +75.bin +76.bin +77.bin +78.bin +79.bin dizzy.sms__

- and finally we shoul add a header:

__sfk -yes setbytes dizzy.sms 0x7ff0 0x544d5220534547410000000000000040__

- this ROM should now work in SMS emulators, such as __Emulicious__ or __MEKA__

NES __Hero Quest__ (http://shrigley.com/source_code_archive/)
- compile with __PDS6502f.EXE__ to get __A?__ or with __PDS6502c.EXE__ on __DOSBox-X__ to get serial output __ser2.bin__

1) _if you saved data from serial port:_

- unpack it to __0bank?.bin__ with __pds2rom.exe ser2.bin__
- trim files with sfk:

__sfk partcopy 0bank0.bin -yes -fromto 0x8000 0xc000 out0.bin__

__sfk partcopy 0bank1.bin -yes -fromto 0x8000 0xc000 out1.bin__

...

__sfk partcopy 0bank6.bin -yes -allfrom 0x8000 out6.bin__

- join all files

__copy /b out0.bin +out1.bin +out2.bin +out3.bin +out4.bin +out5.bin +out6.bin tmp.bin__

2) _if you saved to file:_

- unpack and process this data like so

__pds2rom.exe aa__

__move 0bank0.bin tmp0.bin__

__sfk partcopy tmp0.bin -yes -fromto 0x8000 0xc000 out0.bin__

__pds2rom.exe ab__

__move 0bank0.bin tmp1.bin__

__sfk partcopy tmp1.bin -yes -fromto 0x8000 0xc000 out1.bin__

...

__pds2rom.exe ah__

__move 0bank0.bin tmp7.bin__

__sfk partcopy tmp7.bin -yes -allfrom 0xc000 out7.bin__

- join all files

__copy /b out0.bin +out1.bin +out2.bin +out3.bin +out4.bin +out5.bin +out6.bin +out7.bin tmp.bin__

3) _continue here in both cases_

- prepend __tmp.bin__ with a 16 byte header using an HEX editor or with __sfk setbytes__

4E 45 53 1A 08 00 20 00-00 00 00 00 00 00 00 00

__sfk -yes make-random-file header 16__

__sfk -yes setbytes header 0 0x4e45531a080020000000000000000000__

__copy /b header +tmp.bin hq.nes__

- now you can open this ROM in any NES emulator

NES __NES Tank Game__ (http://www.iancgbell.clara.net/nestank/)

this game was produced on 6502 PDS/2 and since it is currently MIA we'll have to sqeeze it into an PDS project

- rename following files:

__move BZLINE.PDS 1.PDS__

__move BZLOGS.PDS 2.PDS__

__move BZMATH.PDS 3.PDS__

__move BZDVLP.PDS 4.PDS__

__move BZNMIR.PDS 5.PDS__

__move BZNTRA.PDS 6.PDS__

__move BZLAST.PDS 7.PDS__

__copy BZDFNS.PDS +BZFRST.PDS +BZFRGR.PDS 0.PDS__

- now let's create a FF pattern filled 64kb overlay file

__sfk make-zero-file bank 0x10000__

__sfk rep bank -yes -binary /00000000/ffffffff/__

- in __0.PDS__ set __ROMCODE__ to __1__, __TESTSTUFF__ to __0__ and replace __SEND ROMFILE,TANK.ROM,128__ with

__SEND COMPUTER1__
- in __0.PDS__, where __BZFRST.PDS__ would end (after __noobj equ (*-OBJDEF)/16__) add

 __include BZMACR.PDS__

- compile the game and then process two output files like so

__pds2rom.exe aa bank__

__move 0bank0.bin tmp0.bin__

__sfk partcopy tmp0.bin -yes -fromto 0x8000 0x10000 out0.bin__

__sfk partcopy tmp0.bin -yes -fromto 0 0x8000 out1.bin__

__pds2rom.exe ab bank__

__move 0bank0.bin tmp1.bin__

__sfk -yes make-random-file header 16__

__sfk -yes setbytes header 0 0x4e45531a080010000000000000000000__

__copy /b header +out0.bin +out1.bin +tmp1.bin tank.nes__

- you should now have a ROM image matching to the one Ian Bell shared on his website

NES __Elite__ (http://www.elitehomepage.org/archive/index.htm)

same as with the __NES Tank Game__ this is a PDS/2 project so we should take care to downconvert it to PDS

PDS can load up to 8 files of a limited size; loops can not be used in include files; includes can not be nested

- first move all .PDS files from both subdirectories to the outer one, where __NELITE.PRJ__ is
- go through all the .PDS files and correct __incbin__ file references to relative ones e.g.

__CFAC6OBJ.DAT__ should be __NIEL1\CFAC6OBJ.DAT__

__C:\PDS\JOEL1\NTSCTOK.dat__ -> __JOEL1\NTSCTOK.dat__

__\PDS\JOEL1\WORDSD.DAT__ -> __JOEL1\WORDSD.DAT__

they are in 8 files in total and all the references from each file are to one of subdirectories, i.e. paths dont mix

- examine __NELITE.PRJ__ and note the file order, we will try to replicate it

0)

- rename __NELITE0.PDS__ to __0.PDS__: __move NELITE0.PDS 0.PDS__
- in __0.PDS__ delete 200something spaces at the end of line __228__ (__pic2bank EQU 4+STBANK__) & line __230__
- in __0.PDS__ change both __SEND ROMFILE__ lines to __SEND COMPUTER1__
- at the end of __0.PDS__ add the following includes

 __include ELITE1.PDS__

 __include NELITE2.PDS__

 __include ELITE3.PDS__

 __include ELITEG1.PDS__

 __include NELITEG2.PDS__

1)

- __move ELITEA1.PDS 1.PDS__

2)

- go to the line __2137__ in __NELITEA3.PDS__ and cut everything above it. save
- paste your clipboard in a new file and save it as __2.PDS__, so __fudcl2__ should be the last little block in it
- add the following includes at the end of __2.PDS__:

 __include NELITEA3.PDS__

 __include ELITEA4.PDS__

 __include NELITES.PDS__

so we essentially separated __NELITEA3.PDS__ into two parts to reduce file size and bring loops out of include

3)

- go to the line __1929__ in __NELITES2.PDS__ and cut everything above it. save
- paste your clipboard in a new file and save it as __3.PDS__; it should conclude with a __slmess5I__ text block
- add the following includes at the end of it:

 __include NELITES2.PDS__

 __include ELITEB.PDS__

 __include ELITEC.PDS__

 __include ELITED.PDS__

 __include ELITEE.PDS__

 __include ELITEF.PDS__

 __include ELITEH.PDS__

4)
- __move ELITEI.PDS 4.PDS__

5)
the unfortunate thing with __NELITEJ.PDS__ is that it exceeds the size limit and has loops throughout it

so we'll really have to carve this one up to pieces

- create a new __5.PDS__ file and add in it

 __include NELITEJ1.PDS__

- cut everything above the line __1188__ from __NELITEJ.PDS__ and paste it into a new __NELITEJ1.PDS__ file
- cut everything above the line __720__ from __NELITEJ.PDS__ and paste it into __5.PDS__ below include

this block should start with __traL1__ and conclude with __LOOP__

- at the end of __5.PDS__ add

 __include NELITEJ2.PDS__

- cut everything starting (so going down this time) with the __sequence__ label on the line __1226__ from __NELITEJ.PDS__

and paste it at the end of __5.PDS__

- rename __NELITEJ.PDS__ to __NELITEJ2.PDS__; it should start with __GINF TXA__ and conclude with __RTS__ instruction
6)
- __move NELITEK.PDS 6.PDS__

- add these 3 includes at the end of it:

 __include NELITEL1.PDS__

 __include ELITEL2.PDS__

 __include ELITEM.PDS__

7)
- __move NELITEZ.PDS 7.PDS__


if you'd try to compile now, PDS will complain about a syntax error in __NELITEL1.PDS__

we'll have to modify some macros to compensate for the missing bank reference functionality

of the older program version we're using

- find and replace all 6 instances of __#|@1__ with __#@2__
- also in __NELITEL1.PDS__ replace __#|TT66__ with __#0__ and __#|LL145__ with __#1__
- now we should supply a 2nd parameter to every instance of 1 of 4 __SMARTJMP__ macros we just modified

the first one is on the line __452__, add __,6__ at the end of it

- the next one is on the line __463__, add __,6__ at the end of it
- add __,6__ to the end of line __465__ and __474__
- continue searching for __SMARTJMP__ and adding values __5,4,4,3,6,1,3,1,6,1,1,1,3,3,4,6,6,4,6,0,0,3__

until youll come to a commented out __SENDPALLETE SMARTJMP SENDPALLETEtrue__ line; let's ignore this one
- continue down adding: __3,3,3,6,3,6,6,3,3,6,0,5,5__ until __GETPWRFACE SMARTJMP3 GETPWRFACEtrue__

which should be ignored
- add seven more parameters __4,4,6,6,0,6,6__ and ignore commented out __NOISE SMARTJMP3 NOISEtrue__
- supply two more parameters __6,6__ for macros and ignore __BOXINPUT SMARTJMP2 BOXINPUTtrue__

excluded with __IF__ directive
- continue adding from __GTNME__ __6,6,6,6,0,2,2,2,3,3,3,3,3,3,3,3,3,0,6,0,1,2,2,2,2,0,0,1,3,1,0__ up until __ENDTMODEsmart__

take care to add the parameter before the comment on the line __631__

- the game should now compile, producing 8 output files
- like with __NES Tank__, create a FF pattern filled 64kb overlay file

__sfk make-zero-file bank 0x10000__

__sfk rep bank -yes -binary /00000000/ffffffff/__

- unpack all the binaries

__pds2rom.exe aa bank__

__move 0bank0.bin tmp0.bin__

...

__pds2rom.exe ah bank__

__move 0bank0.bin tmp7.bin__

- remove the garbage

__sfk partcopy tmp0.bin -yes -fromto 0x8000 0xc000 out0.bin__

__sfk partcopy tmp1.bin -yes -fromto 0x8000 0xc000 out1.bin__

...

__sfk partcopy tmp7.bin -yes -fromto 0xc000 0x10000 out7.bin__

- don't forget the header

__sfk -yes make-random-file header 16__
__sfk -yes setbytes header 0 0x4e45531a080012000000000000000000__
- and finally we join all the banks to produce a working ROM image

__copy /b header +out6.bin +out1.bin +out2.bin +out3.bin +out0.bin +out4.bin +out5.bin +out7.bin elite.nes__
- you can pat yourself on the back now for hacking the original NES Elite source code to a working state

### Oh No! More PDS:
- __Buggy Boy__ (ZX)

https://web.archive.org/web/20031209144200/http://maz.spork.dk/src/index.html
- __Jeroen Tel's music__ (SMS)

https://www.smspower.org/forums/12696-JeroenTelSourceCode
- __Super Robin Hood__ (NES)

https://github.com/Wireframe-Magazine/Wireframe-34
- __Chicken Run__ (GBC) with GB PDS

https://archive.org/details/chicken-run-gbc-source-code-sep-7-2000
- x86 __PDS for Konix Multi-system__

http://www.konixmultisystem.co.uk/index.php?id=downloads

https://www.youtube.com/watch?v=kicsmgNn-VQ

* PDS6502.EXE was kindly provided by CSDb community
* sfk is __Swiss File Knife__ http://stahlworks.com/dev/swiss-file-knife.html
* PDS has a built in __SEND MSDOS,file.ext__ command for output to file

but it has a problem with multi bank output overwriting itself

to amend this I provided modified __f__ exe versions

it is better to not specify this MSDOS output with those hacked versions

but just send to either COMPUTER1/2 or SERIAL and everything should go to file

* older PDSZ80 projects appear to compile well with P2Z80

* P2Z80 has additional __SEND ROMFILE,file.ext,128__ & __SEND ROM__ commands discussed here:

https://worldofspectrum.org/forums/discussion/9588/
* if you have other versions of PDS, particularly PDS/2 for 6502

please upload them on archive.org or github or some other public place