On Sun, 12 Dec 2021 11:58:23 -0800 (PST)
Post by Jim LeonardOn Sun, 21 Nov 2021 13:50:31 +0000
Post by Kerr-Mudd, JohnI've been looking at small tetris games; doable in <256 bytes; I'm at
241 (219 with a different look), I'll look at adding "drop" and
maybe scoring.
It would be more interesting, and less mangled, for you to post the .asm source instead of a binary hex dump.
Where's the fun in that?
OK you can have a 'u' debug dump for a bit of clarity.
I've improved it slightly; I have 7 spare bytes now, so this doesn't match the previous hexdump.
Note the cunning use of /movsb/ to move through the lines; often copying in place!
also that /bright/=blockchar (8)
; assumes ax=0 ,ss=ds on entry, also that int 10 puts spaces (0x20) to screen area
->u 100 l100
162E:0100 40 inc ax
162E:0101 CD 10 int 10
162E:0103 68 00 B8 push B800
162E:0106 07 pop es
162E:0107 06 push es
162E:0108 1F pop ds
162E:0109 E4 40 in al,40
162E:010B 83 E0 07 and ax,0007
162E:010E BB 08 08 mov bx,0808
162E:0111 08 C7 or bh,al
162E:0113 95 xchg ax,bp
162E:0114 8B AE F1 01 mov bp,[bp+01F1]
162E:0118 81 E5 F0 0F and bp,0FF0
162E:011C 41 inc cx
162E:011D BF C0 FF mov di,FFC0
162E:0120 E3 04 jcxzw 0126
162E:0122 E2 05 loopw 0129
162E:0124 B1 0A mov cl,0A
162E:0126 83 C7 50 add di,0050
162E:0129 60 pushaw
162E:012A BF 80 07 mov di,0780
162E:012D B1 0C mov cl,0C
162E:012F B8 DB 08 mov ax,08DB
162E:0132 F3 AB repz stosw
162E:0134 BE 32 07 mov si,0732
162E:0137 8A 16 1E 00 mov dl,[001E]
162E:013B 83 EF 68 sub di,0068
162E:013E B1 0A mov cl,0A
162E:0140 B6 08 mov dh,08
162E:0142 AB stosw
162E:0143 A4 movsb
162E:0144 22 34 and dh,[si]
162E:0146 A4 movsb
162E:0147 E2 FA loopw 0143
162E:0149 AB stosw
162E:014A 74 04 jz 0150
162E:014C 83 C7 50 add di,0050
162E:014F 42 inc dx
162E:0150 83 EE 64 sub si,0064
162E:0153 73 E6 jnb 013B
162E:0155 BF 1C 00 mov di,001C
162E:0158 92 xchg ax,dx
162E:0159 3C 3A cmp al,3A
162E:015B 72 07 jb 0164
162E:015D 2C 0A sub al,0A
162E:015F FE 05 inc byte [di]
162E:0161 80 0D 30 or byte [di],30
162E:0164 AF scasw
162E:0165 0C 30 or al,30
162E:0167 AA stosb
162E:0168 61 popaw
162E:0169 B4 01 mov ah,01
162E:016B CD 16 int 16
162E:016D 74 09 jz 0178
162E:016F 98 cbw
162E:0170 CD 16 int 16
162E:0172 88 E0 mov al,ah
162E:0174 3C 01 cmp al,01
162E:0176 74 57 jz 01CF
162E:0178 57 push di
162E:0179 3C 4D cmp al,4D
162E:017B 75 01 jnz 017E
162E:017D AF scasw
162E:017E 3C 4B cmp al,4B
162E:0180 75 02 jnz 0184
162E:0182 4F dec di
162E:0183 4F dec di
162E:0184 55 push bp
162E:0185 3C 48 cmp al,48
162E:0187 74 4C jz 01D5
162E:0189 3C 50 cmp al,50
162E:018B 75 02 jnz 018F
162E:018D 31 C9 xor cx,cx
162E:018F 99 cwd
162E:0190 89 D8 mov ax,bx
162E:0192 E8 1E 00 call 01B3
162E:0195 75 53 jnz 01EA
162E:0197 5A pop dx
162E:0198 5A pop dx
162E:0199 BA DA 03 mov dx,03DA
162E:019C E8 14 00 call 01B3
162E:019F 74 03 jz 01A4
162E:01A1 E9 65 FF jmp 0109
162E:01A4 51 push cx
162E:01A5 B1 06 mov cl,06
162E:01A7 EC in al,dx
162E:01A8 A8 08 test al,08
162E:01AA 74 FB jz 01A7
162E:01AC E2 F9 loopw 01A7
162E:01AE 91 xchg ax,cx
162E:01AF 59 pop cx
162E:01B0 68 20 01 push 0120
162E:01B3 60 pushaw
162E:01B4 B1 10 mov cl,10
162E:01B6 F6 C1 03 test cl,03
162E:01B9 75 03 jnz 01BE
162E:01BB 83 C7 48 add di,0048
162E:01BE D1 C5 rol bp,1
162E:01C0 73 10 jnb 01D2
162E:01C2 08 D2 or dl,dl
162E:01C4 74 0A jz 01D0
162E:01C6 AB stosw
162E:01C7 0A 75 4E or dh,[di+4E]
162E:01CA E2 EA loopw 01B6
162E:01CC 84 C6 test dh,al
162E:01CE 61 popaw
162E:01CF C3 ret
162E:01D0 0A 35 or dh,[di]
162E:01D2 AF scasw
162E:01D3 EB F5 jmp 01CA
162E:01D5 51 push cx
162E:01D6 B1 10 mov cl,10
162E:01D8 B8 11 11 mov ax,1111
162E:01DB C1 C5 04 rol bp,04
162E:01DE D1 D0 rcl ax,1
162E:01E0 73 02 jnb 01E4
162E:01E2 D1 CD ror bp,1
162E:01E4 E2 F5 loopw 01DB
162E:01E6 95 xchg ax,bp
162E:01E7 59 pop cx
162E:01E8 EB A5 jmp 018F
162E:01EA 5D pop bp
162E:01EB 5F pop di
162E:01EC 83 FF C0 cmp di,FFC0
162E:01EF 75 A8 jnz 0199
162E:01F1 C3 ret
162E:01F2 66 36 16 ss:push ss
162E:01F5 27 daa
162E:01F6 47 inc di
162E:01F7 F7 F0 div ax
Those last 8 bytes (yes, including the ret!) encode the tetris shape data
--
Bah, and indeed Humbug.