Skip to content

Commit 1c2f1c7

Browse files
franeklubijaens
andauthored
Add 8086 compatibility (#8)
* Figure out the pushes needed * Introduce some new consts * Optimize for size. (#4) * Optimize for size. Main changes: * Switch to using `bp` as the pointer to the variable area instead of using absolute memory references (saves 1 byte per modr/m). * Use `ds` segment override for `movsb` and `es` segment override for `lodsb` to "reverse" the segments. * Clear the variable area in one pass. Currently 17 bytes left over. * Optimize further * Use bytes instead of words for sprite positions * Use `lea` * Optimize: Load two byte registers using a single word operation * Fix variable clearing Only the source segment of string ops can be overridden, but unfortunately not the `es` destination segment. * A bit more constant 0 optimizations * Fix newlines; Correct makefile * Update README.md Co-authored-by: Jaen <639345+jaens@users.noreply.github.com>
1 parent f7ac8e2 commit 1c2f1c7

File tree

4 files changed

+127
-122
lines changed

4 files changed

+127
-122
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*.bin
22
*.img
3+
*.lst
4+
*.lst.*

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
Dino is a bootsector game (512 bytes) written in 16-bit x86 assembly, that's based on Chrome's t-rex runner game!
1414

15+
The game can now be assembled for CPU 8086!
16+
1517
---
1618
* [How to play](#how-to-play)
1719
* [How to compile](#how-to-compile)
@@ -62,15 +64,11 @@ $ make floppy
6264
* I wish to thank [nanochess (Oscar Toledo)](https://github.com/nanochess) for inspiring me to make this project and for writing his book ([Programming Boot Sector Games](https://nanochess.org/store.html)), that helped me greatly.
6365
* I'd also like to thank Mateusz, for helping me with creating the sprites included in the code.
6466

65-
66-
<small>
67-
For now, the game can be assembled for CPU 186 and up
68-
</small>
6967
<br>
7068
<small>
7169
Dino: 512 bytes
7270
</small>
7371
<br>
7472
<small>
75-
This README: 2181 bytes (not counting the preview gif)
73+
This README: 2154 bytes (not counting the preview gif)
7674
</small>

0 commit comments

Comments
 (0)