There are no reviews yet. Be the first to send feedback to the community and the maintainers!
,--------.,--. '--. .--'`--',--,--, ,--. ,--.,--,--. ,---. ,--,--,--. | | ,--.| \ \ ' /' ,-. |( .-' | | | | | || || | \ ' \ '-' |.-' `)| | | | `--' `--'`--''--'.-' / `--`--'`----' `--`--`--' `---' Tinyasm 8086/8088 assembler by Oscar Toledo G. Oct/02/2019 https://nanochess.org/ https://github.com/nanochess/tinyasm Tinyasm is a small assembler for 8086/8088 programs, and it can work over a real PC XT machine. It requires at least 128K of memory, maybe more. It came to my attention that several people wanted to assemble my boot sector games over real PC XT machines. Unfortunately, nasm doesn't run over 8086/8088 processors, and I couldn't find a compatible assembler! So what does a programmer when doesn't find the required tool? Start to code his own tool! It took me 3 days to start from zero and get a working assembler compatible with the nasm syntax, plus all the directives I've used in my boot sector programs. Using the same command line syntax as nasm: tinyasm -f bin rogue.asm -o rogue.img -l rogue.lst There is also the -d option for defining labels: -dCOM_FILE -dCOM_FILE=1 It returns a non-zero error code when the assembled file generates errors. Thanks to tkchia for making it portable to ia16-elf-gcc, removing DeSmet C warnings, and making it to return error codes. Thanks to humbertocsjr for contributing the INCBIN command. >> DIFFERENCES BETWEEN TINYASM AND NASM >> The main difference is that Tinyasm won't insert long jumps for miscalculated conditional jumps. Labels are started with letter, underscore or period. Case is insensitive. Local labels are supported, and should start with period. The local labels final name is derived from concatenation of the last global label (not starting with period) and the local label. There is only support for 8086/8088 processors, and only are implemented the following directives: %ifdef %ifndef %if %else %endif %include incline times use16 cpu 8086 equ db dw The following operators are implemented: | Binary OR ^ Binary XOR & Binary AND << Shift to left >> Shift to right + Addition - Subtraction * Multiplication / Division (unsigned 16-bit) % Modulo operator (expr) Parenthesis - Unary negation The following numbers are implemented: 0b0000_0100 Binary, you can use underscore (it will be ignored) 0xabcd Hexadecimal. $0abcd Hexadecimal (after $ the first digit must be a number) 'a' Character constant. 10 Decimal. $$ Start address. $ Current address. This assembler won't win a speed test ;) because the internal implementation uses a linear search for the instruction set, and it is also implemented as a kind of regular expression subset for easier coding. >> DEBUG NOTES << If you're building boot sector games with Tinyasm, then you need the following info to load the game inside the boot sector of a floppy disk. You need to have DEBUG in your disk (included with the DOS disks). Do the following (replace filename as desired): DEBUG ROGUE.IMG Extract now your working disk and insert a blank one!!! A300 MOV AX,0301 MOV BX,0100 MOV CX,1 MOV DX,0 INT 13 JB 300 INT 20 RIP 300 G Now the boot sector is replaced with the program!!! >> BUILDING THE ASSEMBLER >> You can build your own executable for Tinyasm using the C compiler Desmet C, version 3.1h available graciously at: http://www.desmet-c.com/ The compiler has many bugs and limitations, but it works for tinyasm purposes, and it's freely available. Supposedly it should support ANSI C, but I couldn't fit a standard ANSI C function definition, so I had to code again in C K&R for the first time in maybe 20 years! You can find the "e.bat" file to assemble the compiler. I provide an executable on the Git to save you some time. There are test cases in the 'test' subdirectory that are runnable with the "test.bat" file. There is a test for the full instruction set of 8086/8088 (the same listing that appears in my book Programming Boot Sector Games). The test cases come from my own programs: https://github.com/nanochess/fbird https://github.com/nanochess/invaders https://github.com/nanochess/pillman https://github.com/nanochess/bootBASIC https://github.com/nanochess/bootOS https://github.com/nanochess/bootRogue >> ATTENTION << Would you like to learn 8086/8088 programming? Then you must get my new book Programming Boot Sector Games including a 8086/8088 crash course! Now available from Lulu: Soft-cover http://www.lulu.com/shop/oscar-toledo-gutierrez/programming-boot-sector-games/paperback/product-24188564.html Hard-cover http://www.lulu.com/shop/oscar-toledo-gutierrez/programming-boot-sector-games/hardcover/product-24188530.html eBook https://nanochess.org/store.html These are some of the example programs documented profusely in the book: * Guess the number. * Tic-Tac-Toe game. * Text graphics. * Mandelbrot set. * F-Bird game. * Invaders game. * Pillman game. * Toledo Atomchess. * bootBASIC language. After the success of my first book, if you need even More Boot Sector Games then you must get this book! Soft-cover http://www.lulu.com/shop/oscar-toledo-gutierrez/more-boot-sector-games/paperback/product-24462035.html Hard-cover http://www.lulu.com/shop/oscar-toledo-gutierrez/more-boot-sector-games/hardcover/product-24462029.html These are some of the example programs documented profusely in the book: * Follow the Lights * bootRogue * bricks * cubicDoom * bootOS
bootOS
bootOS is a monolithic operating system in 512 bytes of x86 machine code.Invaders
Invaders game in 512 bytes (boot sector)bootBASIC
bootBASIC is a BASIC language in 512 bytes of x86 machine code.Pillman
Pillman boot sector game, a yellow thing eats pills and is chased by monsters.RayTracer
Ray Tracer in 483 bytes (x86 boot sector)bootLogo
Logo language in 508 bytes (x86 boot sector)cubicDoom
A ray-casting game in 512 bytes of x86 machine codeToledo-Atomchess
Toledo Atomchess is the world's smallest chess program in x86 assembly codebootRogue
bootRogue, a roguelike game that fits in a boot sector (510 bytes)fbird
A boot sector game in text modepi
Pi number calculator using 8088 assembly languagebootle
Bootle (a Wordle clone in a x86 boot sector)book8088
Examples from my book Programming Boot Sector GamesIntyBASIC
IntyBASIC compiler for Intellivision (CP1610 processor)pretty6502
A pretty printer for 6502, Z80, CP1610, TMS9900, and 8088 assembler codeCVBasic
BASIC language compiler for Colecovision, MSX, SG1000, Spectravideo SVI-318/328, Creativision, Sord M5, Memotech MTX, Tatung Einstein, Casio PV-2000, and Hanimex/Soundic Pencil II.bricks
A game of bricks and paddle on one boot sector (510 bytes)book-Atari
Examples from my book Programming Games for Atari 2600Atomchess-6502
Toledo Atomchess for Atari VCS/2600z80rogue
A Roguelike game for MSXgasm80
Gasm80: Generic assembler for Z80/6502Pletter
Pletter compressor, used in MSX/Colecovision games240pTestSuite_colecovision
240p Test Suite for Colecovision/MSX/SG1000heart
x86 16-bit program drawing the heart curve equationTtris
Ttris is a tetraminoes game for TRS-80 Model 1/3 computers.lights
Follow the Lights boot sector game in only 510 bytes of x86 machine code.Zombie-Near
Zombie Near for MSX, Colecovision, Memotech, Tatung Einstein and Spectravideo.Space-Raid
Space Raid game for Atari VCS/2600sphere
Draws a wireframe sphere in Javascript and exports it to GIF fileSpace-Raid-Inty
Space Raid for Intellivisionc6502
Atari VCS 6502 to IntyBASIC compilerTMSColor
Converts a BMP image to TMS9928 bitmap/color format in assembler or CVBasic language.IntyColor
Utility for conversion of BMP images to Intellivision screen formatti994a
TI994A snippets (Astro Cube and Hello)psg2bas
Convert CoolCV PSG log files into IntyBASIC compilable programLove Open Source and this site? Check out how you can help us