Reverse Engineering for Beginners

(avery) #1

CHAPTER 83. DEMOS CHAPTER 83. DEMOS


Chapter 83


Demos


Demos (or demomaking) were an excellent exercise in mathematics, computer graphics programming and very tight x86
hand coding.


83.1 10 PRINT CHR$(205.5+RND(1)); : GOTO 10


All examples here are MS-DOS .COM files.


In [al12] we can read about one of the most simple possible random maze generators. It just prints a slash or backslash
characters randomly and endlessly, resulting in something like this:


There are a few known implementations for 16-bit x86.


83.1.1 Trixter’s 42 byte version.


The listing was taken from his website^1 , but the comments are mine.


00000000: B001 mov al,1 ; set 40x25 video mode
00000002: CD10 int 010
00000004: 30FF xor bh,bh ; set video page for int 10h call
00000006: B9D007 mov cx,007D0 ; 2000 characters to output
00000009: 31C0 xor ax,ax
0000000B: 9C pushf ; push flags
; get random value from timer chip
0000000C: FA cli ; disable interrupts
0000000D: E643 out 043,al ; write 0 to port 43h


(^1) http://go.yurichev.com/17305

Free download pdf