Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

Real programs don't eat cache.


programming / comp.lang.asm.x86 / Small Tetris

SubjectAuthor
* Small TetrisKerr-Mudd, John
`* Re: Small TetrisKerr-Mudd, John
 +* Re: Small TetrisKerr-Mudd, John
 |`* Re: Small TetrisKerr-Mudd, John
 | `* Re: Small TetrisKerr-Mudd, John
 |  `- Re: Small TetrisKerr-Mudd, John
 `* Re: Small TetrisJim Leonard
  `* Re: Small TetrisKerr-Mudd, John
   `* Re: Small TetrisTerje Mathisen
    `- Re: Small TetrisKerr-Mudd, John

1
Subject: Small Tetris
From: Kerr-Mudd, John
Newsgroups: alt.lang.asm, comp.lang.asm.x86
Organization: Dis
Date: Sun, 21 Nov 2021 13:50 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: alt.lang.asm,comp.lang.asm.x86
Subject: Small Tetris
Date: Sun, 21 Nov 2021 13:50:31 +0000
Organization: Dis
Lines: 9
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="28a0bed3b091f0ef7ea58e4b5f34a56c";
logging-data="16237"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KH7sYQ/pTbv7UuX3tRBO4+4tVxhbOfqg="
Cancel-Lock: sha1:GPBXlGxwfWw+Gl8F+oKpUf1ZyGw=
View all headers

I'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.


--
Bah, and indeed Humbug.



Subject: Re: Small Tetris
From: Kerr-Mudd, John
Newsgroups: alt.lang.asm, comp.lang.asm.x86
Organization: Dis
Date: Sat, 4 Dec 2021 14:08 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: alt.lang.asm,comp.lang.asm.x86
Subject: Re: Small Tetris
Date: Sat, 4 Dec 2021 14:08:42 +0000
Organization: Dis
Lines: 34
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="3a8649aeac2403b3bca7c1c87e7df227";
logging-data="25458"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+R6C9CYvJ67PYMkCs47t5rKlVNcv8Bu+c="
Cancel-Lock: sha1:jNTH/u2y5h4IDwRj2Y7tp1QGnvE=
View all headers
On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:


I'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.

Dropping & scoring (up to 9!) added. still 17 bytes spare!
There's also a(n unavoidable?) bigjumpback in there that wastes 3.
If I could only make the keyin rtn shorter.

->           d 100 l100
16A5:0100 40 CD 10 68-00 B8 07 06-1F 41 E4 40-83 E0 07 BB  @..h.....A.@....
16A5:0110 08 08 08 C7-89 C5 8A 86-E7 01 C1 E0-04 95 BF C0  ................
16A5:0120 FF E3 04 E2-05 B1 0A 83-C7 50 60 BF-80 07 B1 0C  .........P`.....
16A5:0130 B8 DB 08 F3-AB BE 32 07-83 EF 68 B1-0A B2 08 AB  ......2...h.....
16A5:0140 A4 22 14 A4-E2 FA AB 74-07 83 C7 50-FE 06 1A 00  .".....t...P....
16A5:0150 83 EE 64 73-E3 B0 30 08-06 1A 00 61-B4 01 CD 16  ..ds..0....a....
16A5:0160 74 0A B4 00-CD 16 88 E0-3C 01 74 58-57 3C 4D 75  t.......<.tXW<Mu
16A5:0170 01 AF 3C 4B-75 02 4F 4F-55 3C 48 74-55 3C 50 75  ..<Ku.OOU<HtU<Pu
16A5:0180 02 31 C9 99-E8 20 00 75-41 5A 5A BA-DA 03 89 D8  .1... .uAZZ.....
16A5:0190 E8 14 00 74-03 E9 71 FF-51 B1 06 EC-A8 08 74 FB  ...t..q.Q.....t.
16A5:01A0 E2 F9 91 59-68 21 01 60-B1 10 F6 C1-03 75 03 83  ...Yh!.`.....u..
16A5:01B0 C7 48 D1 C5-73 11 08 D2-74 0B AB 0A-75 4E E2 EA  .H..s...t...uN..
16A5:01C0 F6 C6 08 61-C3 0A 35 AF-EB F4 5D 5F-83 FF C0 75  ...a..5...]_...u
16A5:01D0 BA C3 51 B1-10 B8 11 11-C1 C5 04 D1-D0 73 02 D1  ..Q..........s..
16A5:01E0 CD E2 F5 95-59 EB 9C 0F-74 36 72 63-71 33 0F 00  ....Y...t6rcq3..
16A5:01F0 00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00  ................


--
Bah, and indeed Humbug.



Subject: Re: Small Tetris
From: Kerr-Mudd, John
Newsgroups: alt.lang.asm, comp.lang.asm.x86, comp.os.dos.programmer
Organization: Dis
Date: Sat, 4 Dec 2021 16:01 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: alt.lang.asm,comp.lang.asm.x86,comp.os.dos.programmer
Subject: Re: Small Tetris
Date: Sat, 4 Dec 2021 16:01:25 +0000
Organization: Dis
Lines: 48
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20211204160125.4dc4a656f7ee07f504714c04@127.0.0.1>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
<20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="3a8649aeac2403b3bca7c1c87e7df227";
logging-data="12225"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qQRUUrPQE0C5enWE4N8RonJNjRk0nugg="
Cancel-Lock: sha1:fHJsd38jl27gtZI/qcHNJkRujKA=
View all headers
On Sat, 4 Dec 2021 14:08:42 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:


I'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.

Dropping & scoring (up to 9!) added. still 17 bytes spare!
There's also a(n unavoidable?) bigjumpback in there that wastes 3.
If I could only make the keyin rtn shorter.

[]
 

Sorry if it wraps: here's one where you can max out at 99!
(but only 1 byte left)

[I've copied in dos programmer]

->           d 100 l100
16A5:0100 40 CD 10 68-00 B8 07 06-1F 41 E4 40-83 E0 07 BB  @..h.....A.@....
16A5:0110 08 08 08 C7-89 C5 8A 86-F7 01 C1 E0-04 95 BF C0  ................
16A5:0120 FF E3 04 E2-05 B1 0A 83-C7 50 60 BF-80 07 B1 0C  .........P`.....
16A5:0130 B8 DB 08 8A-1E 1E 00 F3-AB BE 32 07-83 EF 68 B1  ..........2...h.
16A5:0140 0A B2 08 AB-A4 22 14 A4-E2 FA AB 74-04 83 C7 50  .....".....t...P
16A5:0150 43 83 EE 64-73 E6 BF 1C-00 88 D8 80-EB 3A 72 07  C..ds........:r.
16A5:0160 FE 05 80 0D-30 88 D8 AF-0C 30 AA 61-B4 01 CD 16  ....0....0.a....
16A5:0170 74 0A B4 00-CD 16 88 E0-3C 01 74 58-57 3C 4D 75  t.......<.tXW<Mu
16A5:0180 01 AF 3C 4B-75 02 4F 4F-55 3C 48 74-55 3C 50 75  ..<Ku.OOU<HtU<Pu
16A5:0190 02 31 C9 99-E8 20 00 75-41 5A 5A BA-DA 03 89 D8  .1... .uAZZ.....
16A5:01A0 E8 14 00 74-03 E9 61 FF-51 B1 06 EC-A8 08 74 FB  ...t..a.Q.....t.
16A5:01B0 E2 F9 91 59-68 21 01 60-B1 10 F6 C1-03 75 03 83  ...Yh!.`.....u..
16A5:01C0 C7 48 D1 C5-73 11 08 D2-74 0B AB 0A-75 4E E2 EA  .H..s...t...uN..
16A5:01D0 F6 C6 08 61-C3 0A 35 AF-EB F4 5D 5F-83 FF C0 75  ...a..5...]_...u
16A5:01E0 BA C3 51 B1-10 B8 11 11-C1 C5 04 D1-D0 73 02 D1  ..Q..........s..
16A5:01F0 CD E2 F5 95-59 EB 9C 0F-74 36 72 63-71 33 0F 00  ....Y...t6rcq3..





--
Bah, and indeed Humbug.



Subject: Re: Small Tetris
From: Kerr-Mudd, John
Newsgroups: alt.lang.asm, comp.lang.asm.x86, comp.os.msdos.programmer
Organization: Dis
Date: Sat, 4 Dec 2021 20:44 UTC
References: 1 2 3
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: alt.lang.asm,comp.lang.asm.x86,comp.os.msdos.programmer
Subject: Re: Small Tetris
Date: Sat, 4 Dec 2021 20:44:01 +0000
Organization: Dis
Lines: 49
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20211204204401.dce2c6b0cf26294f3d89dbf7@127.0.0.1>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
<20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
<20211204160125.4dc4a656f7ee07f504714c04@127.0.0.1>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="3a8649aeac2403b3bca7c1c87e7df227";
logging-data="13581"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18xCgSe/PEERNaXxcj5rhBi3EZWvGnUKWc="
Cancel-Lock: sha1:Zoq09T8ISDB1KGsbrD9Vc71eGOo=
View all headers
On Sat, 4 Dec 2021 16:01:25 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sat, 4 Dec 2021 14:08:42 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:


I'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.

Dropping & scoring (up to 9!) added. still 17 bytes spare!
There's also a(n unavoidable?) bigjumpback in there that wastes 3.
If I could only make the keyin rtn shorter.

[]
 

Sorry if it wraps: here's one where you can max out the score at 99!
(but only 1 byte left)

[I've copied in dos programmer]
/msdos/

->           d 100 l100
16A5:0100 40 CD 10 68-00 B8 07 06-1F 41 E4 40-83 E0 07 BB  @..h.....A.@....
16A5:0110 08 08 08 C7-89 C5 8A 86-F7 01 C1 E0-04 95 BF C0  ................
16A5:0120 FF E3 04 E2-05 B1 0A 83-C7 50 60 BF-80 07 B1 0C  .........P`.....
16A5:0130 B8 DB 08 8A-1E 1E 00 F3-AB BE 32 07-83 EF 68 B1  ..........2...h.
16A5:0140 0A B2 08 AB-A4 22 14 A4-E2 FA AB 74-04 83 C7 50  .....".....t...P
16A5:0150 43 83 EE 64-73 E6 BF 1C-00 88 D8 80-EB 3A 72 07  C..ds........:r.
16A5:0160 FE 05 80 0D-30 88 D8 AF-0C 30 AA 61-B4 01 CD 16  ....0....0.a....
16A5:0170 74 0A B4 00-CD 16 88 E0-3C 01 74 58-57 3C 4D 75  t.......<.tXW<Mu
16A5:0180 01 AF 3C 4B-75 02 4F 4F-55 3C 48 74-55 3C 50 75  ..<Ku.OOU<HtU<Pu
16A5:0190 02 31 C9 99-E8 20 00 75-41 5A 5A BA-DA 03 89 D8  .1... .uAZZ.....
16A5:01A0 E8 14 00 74-03 E9 61 FF-51 B1 06 EC-A8 08 74 FB  ...t..a.Q.....t.
16A5:01B0 E2 F9 91 59-68 21 01 60-B1 10 F6 C1-03 75 03 83  ...Yh!.`.....u..
16A5:01C0 C7 48 D1 C5-73 11 08 D2-74 0B AB 0A-75 4E E2 EA  .H..s...t...uN..
16A5:01D0 F6 C6 08 61-C3 0A 35 AF-EB F4 5D 5F-83 FF C0 75  ...a..5...]_...u
16A5:01E0 BA C3 51 B1-10 B8 11 11-C1 C5 04 D1-D0 73 02 D1  ..Q..........s..
16A5:01F0 CD E2 F5 95-59 EB 9C 0F-74 36 72 63-71 33 0F 00  ....Y...t6rcq3..


--
Bah, and indeed Humbug.



Subject: Re: Small Tetris
From: Jim Leonard
Newsgroups: comp.lang.asm.x86
Organization: A noiseless patient Spider
Date: Sun, 12 Dec 2021 19:58 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: mobyga...@nospicedham.gmail.com (Jim Leonard)
Newsgroups: comp.lang.asm.x86
Subject: Re: Small Tetris
Date: Sun, 12 Dec 2021 11:58:23 -0800 (PST)
Organization: A noiseless patient Spider
Lines: 11
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <2773b6d5-60b5-4445-971b-3a2e44b10f72n@googlegroups.com>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1> <20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Sun, 12 Dec 2021 19:58:24 +0000
Injection-Info: reader02.eternal-september.org; posting-host="1534dcd3aa1937e830c0dba75c786dfd";
logging-data="10192"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dEMlhvpT+wt7FI+85NYZ2KQxI8+iXPHw="
User-Agent: G2/1.0
Cancel-Lock: sha1:clTsFrkzNynJDENGNQMopH9dGbs=
View all headers
On Saturday, December 4, 2021 at 8:20:06 AM UTC-6, Kerr-Mudd, John wrote:
On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <ad...@nospicedham.127.0.0.1> wrote:


I'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.



Subject: Re: Small Tetris
From: Kerr-Mudd, John
Newsgroups: comp.lang.asm.x86
Organization: Dis
Date: Sun, 12 Dec 2021 21:52 UTC
References: 1 2 3
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: comp.lang.asm.x86
Subject: Re: Small Tetris
Date: Sun, 12 Dec 2021 21:52:31 +0000
Organization: Dis
Lines: 160
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20211212215231.2b97e5112947d773dcce70db@127.0.0.1>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
<20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
<2773b6d5-60b5-4445-971b-3a2e44b10f72n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="1534dcd3aa1937e830c0dba75c786dfd";
logging-data="8010"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ro6xnFN5Gon8gG68opg3zNVZq2TsiaKw="
Cancel-Lock: sha1:KZHtLJgUG4oPUG0Ue9gxday4J1A=
View all headers
On Sun, 12 Dec 2021 11:58:23 -0800 (PST)
Jim Leonard <mobygamer@nospicedham.gmail.com> wrote:

On Saturday, December 4, 2021 at 8:20:06 AM UTC-6, Kerr-Mudd, John wrote:
On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <ad...@nospicedham.127.0.0.1> wrote:


I'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

Click here to read the complete article
Subject: Re: Small Tetris
From: Terje Mathisen
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Mon, 13 Dec 2021 14:36 UTC
References: 1 2 3 4
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: terje.ma...@nospicedham.tmsw.no (Terje Mathisen)
Newsgroups: comp.lang.asm.x86
Subject: Re: Small Tetris
Date: Mon, 13 Dec 2021 15:36:25 +0100
Organization: Aioe.org NNTP Server
Lines: 47
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <sp7lp9$12p7$1@gioia.aioe.org>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
<20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
<2773b6d5-60b5-4445-971b-3a2e44b10f72n@googlegroups.com>
<20211212215231.2b97e5112947d773dcce70db@127.0.0.1>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="1f1b228560bc4027a7754fe91c2c43ea";
logging-data="26614"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194v9uKZvBM8hiMym4EETWa3q/mWW1B+ig="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.10
Cancel-Lock: sha1:Iyr3+8XanFIJ8yOT7+2UrQtSq7w=
View all headers
Kerr-Mudd, John wrote:
On Sun, 12 Dec 2021 11:58:23 -0800 (PST)
Jim Leonard <mobygamer@nospicedham.gmail.com> wrote:

On Saturday, December 4, 2021 at 8:20:06 AM UTC-6, Kerr-Mudd, John wrote:
On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <ad...@nospicedham.127.0.0.1> wrote:


I'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

[snip]

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

That's very impressive John!

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"



Subject: Re: Small Tetris
From: Kerr-Mudd, John
Newsgroups: comp.lang.asm.x86
Organization: Dis
Date: Mon, 13 Dec 2021 16:04 UTC
References: 1 2 3 4 5
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: comp.lang.asm.x86
Subject: Re: Small Tetris
Date: Mon, 13 Dec 2021 16:04:05 +0000
Organization: Dis
Lines: 65
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20211213160405.bbee8e641e59e79358ff7138@127.0.0.1>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
<20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
<2773b6d5-60b5-4445-971b-3a2e44b10f72n@googlegroups.com>
<20211212215231.2b97e5112947d773dcce70db@127.0.0.1>
<sp7lp9$12p7$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="1f1b228560bc4027a7754fe91c2c43ea";
logging-data="22437"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Ku8oyOwjzVjF11GAgDBTiFEVg7gO3S3Q="
Cancel-Lock: sha1:30t02usQ8OadIXi+I1I74Wir2P0=
View all headers
On Mon, 13 Dec 2021 15:36:25 +0100
Terje Mathisen <terje.mathisen@nospicedham.tmsw.no> wrote:

Kerr-Mudd, John wrote:
On Sun, 12 Dec 2021 11:58:23 -0800 (PST)
Jim Leonard <mobygamer@nospicedham.gmail.com> wrote:

On Saturday, December 4, 2021 at 8:20:06 AM UTC-6, Kerr-Mudd, John wrote:
On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <ad...@nospicedham.127.0.0.1> wrote:


I'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

Actually it also requires ch=0 on entry; fixing that takes another 2 bytes. But I have 6 leftover so it could be done.

->u 100 l100
162E:0100 40             inc          ax
162E:0101 CD 10          int          10

[snip]

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

That's very impressive John!

Terje


Thanks. I saw a demoscene version from a chap in Hungary:
https://www.pouet.net/prod.php?which=6951
but that only has 6 shapes, no scoring, no dropping, so I thought I'd see if I could do better

Mine is based on James David Chapman's 1999 /tet.asm/ which I'd made smaller a year or 2 back.
https://comp.lang.asm.x86.narkive.com/tdwb6WKq/pong-256






--
Bah, and indeed Humbug.



Subject: Re: Small Tetris
From: Kerr-Mudd, John
Newsgroups: alt.lang.asm, comp.lang.asm.x86, comp.os.msdos.programmer
Organization: Dis
Date: Tue, 14 Dec 2021 10:25 UTC
References: 1 2 3 4
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: alt.lang.asm,comp.lang.asm.x86,comp.os.msdos.programmer
Subject: Re: Small Tetris
Date: Tue, 14 Dec 2021 10:25:17 +0000
Organization: Dis
Lines: 60
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20211214102517.e17f51e21b0fadadcf95a829@127.0.0.1>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
<20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
<20211204160125.4dc4a656f7ee07f504714c04@127.0.0.1>
<20211204204401.dce2c6b0cf26294f3d89dbf7@127.0.0.1>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="2538d382b957e8dfb4797aaeae8d33b0";
logging-data="23992"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BzIlQiYrdvXwpDNRwUbhr1wtpnDrFw4s="
Cancel-Lock: sha1:Ymh5QEDbjRuiYnG8+AmvWjuK88A=
View all headers
On Sat, 4 Dec 2021 20:44:01 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sat, 4 Dec 2021 16:01:25 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sat, 4 Dec 2021 14:08:42 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:


I'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.

Dropping & scoring (up to 9!) added. still 17 bytes spare!
There's also a(n unavoidable?) bigjumpback in there that wastes 3.
If I could only make the keyin rtn shorter.

[]
 

Sorry if it wraps: here's one where you can max out the score at 99!
(but only 1 byte left)

[I've copied in dos programmer]
/msdos/


More robust version (doesn't rely on ax=0, ch=0 at start, or trailing 0)

->           d 100 l100
162E:0100 B8 01 00 89-C1 CD 10 68-00 B8 07 06-1F E4 40 83  .......h......@.
162E:0110 E0 07 BB 08-08 08 C7 95-8B AE F5 01-81 E5 F0 0F  ................
162E:0120 41 BF C0 FF-E3 04 E2 05-B1 0A 83 C7-50 60 BF 80  A...........P`..
162E:0130 07 B1 0C B8-DB 08 F3 AB-BE 32 07 8A-16 1E 00 83  .........2......
162E:0140 EF 68 B1 0A-B6 08 AB A4-22 34 A4 E2-FA AB 74 04  .h......"4....t.
162E:0150 83 C7 50 42-83 EE 64 73-E6 BF 1C 00-92 3C 3A 72  ..PB..ds.....<:r
162E:0160 07 2C 0A FE-05 80 0D 30-AF 0C 30 AA-61 B4 01 CD  .,.....0..0.a...
162E:0170 16 74 09 98-CD 16 88 E0-3C 01 74 57-57 3C 4D 75  .t......<.tWW<Mu
162E:0180 01 AF 3C 4B-75 02 4F 4F-55 3C 48 74-4C 3C 50 75  ..<Ku.OOU<HtL<Pu
162E:0190 02 31 C9 99-89 D8 E8 1E-00 75 53 5A-5A BA DA 03  .1.......uSZZ...
162E:01A0 E8 14 00 74-03 E9 65 FF-51 B1 06 EC-A8 08 74 FB  ...t..e.Q.....t.
162E:01B0 E2 F9 91 59-68 24 01 60-B1 10 F6 C1-03 75 03 83  ...Yh$.`.....u..
162E:01C0 C7 48 D1 C5-73 10 08 D2-74 0A AB 0A-75 4E E2 EA  .H..s...t...uN..
162E:01D0 84 C6 61 C3-0A 35 AF EB-F5 51 B1 10-B8 11 11 C1  ..a..5...Q......
162E:01E0 C5 04 D1 D0-73 02 D1 CD-E2 F5 95 59-EB A5 5D 5F  ....s......Y..]_
162E:01F0 83 FF C0 75-A8 C3 66 36-16 27 47 F7-F0 00 00 00  ...u..f6.'G.....


--
Bah, and indeed Humbug.



--
Bah, and indeed Humbug.



Subject: Re: Small Tetris
From: Kerr-Mudd, John
Newsgroups: alt.lang.asm, comp.lang.asm.x86, comp.os.msdos.programmer
Organization: Dis
Date: Fri, 19 May 2023 17:18 UTC
References: 1 2 3 4 5
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: adm...@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: alt.lang.asm,comp.lang.asm.x86,comp.os.msdos.programmer
Subject: Re: Small Tetris
Date: Fri, 19 May 2023 18:18:18 +0100
Organization: Dis
Lines: 63
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20230519181818.ac1d4b1ad93fcf20a569606d@127.0.0.1>
References: <20211121135031.93ec8b03d30970ef0c90c976@127.0.0.1>
<20211204140842.304b5e3512e1e8ef81960a3c@127.0.0.1>
<20211204160125.4dc4a656f7ee07f504714c04@127.0.0.1>
<20211204204401.dce2c6b0cf26294f3d89dbf7@127.0.0.1>
<20211214102517.e17f51e21b0fadadcf95a829@127.0.0.1>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="f5e2745d9daf79de8a025d1bcd843580";
logging-data="824249"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193g9RXWGmIsaupxnXQXP7SMO34f4LTflI="
Cancel-Lock: sha1:rreG7YIR0wt/siTRv2pqAIGQ+wQ=
View all headers
On Tue, 14 Dec 2021 10:25:17 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sat, 4 Dec 2021 20:44:01 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sat, 4 Dec 2021 16:01:25 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sat, 4 Dec 2021 14:08:42 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

On Sun, 21 Nov 2021 13:50:31 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:


I'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.

Dropping & scoring (up to 9!) added. still 17 bytes spare!
There's also a(n unavoidable?) bigjumpback in there that wastes 3.
If I could only make the keyin rtn shorter.

[]
 

Sorry if it wraps: here's one where you can max out the score at 99!
(but only 1 byte left)

[I've copied in dos programmer]
/msdos/



Revisited: now a pure 8086 version (previous ones require 186 for push
value; rol reg,num; and pusha/popa)

255 bytes: still 1 long jmp and 4 lots of push pop cx, so maybe a few bytes
still to squeeze out. Oh, scoring is now unrestricted. No sounds or
speedup, just std play with csr keys (and Esc)

->           d 100 l100
1632:0100 40 CD 10 B7-B8 53 07 06-1F E4 40 83-E0 07 BB 08  @....S....@.....
1632:0110 08 08 C7 95-8B AE F6 01-81 E5 F0 0F-41 BF DC FF  ............A...
1632:0120 E3 04 E2 05-B1 0A 83 C7-50 57 55 51-57 BF 9C 07  ........PWUQW...
1632:0130 B1 0C B8 DB-08 F3 AB BE-4E 07 83 EF-68 B1 0A B6  ........N...h...
1632:0140 08 AB A4 22-34 A4 E2 FA-AB 74 19 83-C7 50 53 50  ..."4....t...PSP
1632:0150 BB 42 00 4B-4B B0 30 86-07 0C 10 3C-39 74 F4 40  .B.KK.0....<9t.@
1632:0160 88 07 58 5B-83 EE 64 73-D1 5F 59 B4-01 CD 16 74  ..X[..ds._Y....t
1632:0170 33 98 CD 16-88 E0 3C 01-74 6D 3C 50-75 02 31 C9  3.....<.tm<Pu.1.
1632:0180 3C 4D 75 01-AF 3C 4B 75-02 4F 4F 3C-48 75 15 51  <Mu..<Ku.OO<Hu.Q
1632:0190 B9 04 10 B8-11 11 D3 C5-D1 D0 73 02-D1 CD FE CD  ..........s.....
1632:01A0 75 F4 95 59-99 89 D8 E8-1F 00 75 43-5A 5A BA DA  u..Y......uCZZ..
1632:01B0 03 E8 15 00-74 03 E9 50-FF 51 B1 06-EC A8 08 74  ....t..P.Q.....t
1632:01C0 FB E2 F9 91-59 BE 20 01-56 51 52 57-B1 10 F6 C1  ....Y. .VQRW....
1632:01D0 03 75 03 83-C7 48 D1 C5-73 12 08 D2-74 0C AB 0A  .u...H..s...t...
1632:01E0 75 4E E2 EA-84 C6 5F 5A-59 C3 0A 35-AF EB F3 5D  uN...._ZY..5...]
1632:01F0 5F 83 FF DC-75 B8 C3 2C-37 16 F7 40-F7 60 03 00  _...u..,7..@.`..

--
Bah, and indeed Humbug.



1
rocksolid light 0.8.3
clearneti2ptor