flat assembler
Message board for the users of flat assembler.

Index > DOS > Three games - 24 bytes each (May Be The Smallest PC Games)

Author
Thread Post new topic Reply to topic
sourcerer



Joined: 06 Apr 2011
Posts: 4
sourcerer 04 Oct 2011, 16:08
It's joke. Only two of them are 24 byte-sized. Third is 27 bytes.
I wrote a topic about this games (on russian!): http://habrahabr.ru/blogs/asm/119765/
Very Happy you can play them if you want. You need DOS or Dosbox of NTVDM, but for third game you should use 8086 Very Happy

First:
First gamer press any key on keyboard. Second gamer press keys on keyboar until he press first pressed key. Otherwise he'll get a hint
Code:
org 100h
;;Guess what key was pressed

 int 16h ;;Wait for keyboard press
 mov bl, al ;;Save keycode

 still: ;;Main loop
 int 29h ;;Print entered symbol

 mov ax, 1*256+13;;al=13 - carriage return, ah=1 - check keyboard
 int 29h

 int 21h

 cmp al, bl ;;compare keycodes
 mov al, '+'
 ja still
 mov al, '-'
 jb still

 true:
 ret
    


Second:
There are 19 sticks on the table. Press number key to take few. You MUST press 1, 2 or 3. Otherwise your PC opponent will be mad 'coz you broke the rules Very Happy So, you and your PC takes sticks from the table until somebody takes last stick
Code:
org 100h
;;Famous Bashe game

 mov dl, 15+4 ;;dl=number of sticks

 still: ;;Main loop
 sub dl, 4
 js fin

 mov ax, 1*100h+'|' ;;Out stick sumbol
 mov cl, dl ;;in loop
 disp: ;;from 1 to cl stick
 int 29h ;;callin 29h
 loop disp

 int 21h

 sub al, '0' ;;Convert ASCII to real number

 cmp dl, al ;;If you take last stick you won
 jne still

 win:
 int 29h ;;Print heart symbol

 fin:
 ret
    


Third:
Try to get three same symbols pressing "right arrow". It's VERY difficult, but few people can do this. You need very slow PC or emulator to play this game.
Code:
;;Roulette (one-handed bandit)

org 100h

 push 0b800H ;;Working with videomemory
 pop ds 

 le: ;;out symbol
 inc bx
 inc bx ;;move cursor

 inf: ;;Almost infinite loop
 int 1AH ;;Call timer
 add dl, bl ;;Avoid player to win with fast "right arrow" pressing
 mov [bx], dl ;;Out symbol to the screen

 ;;Keyboard handle
 in al, 60H
 cmp al, 77 ;;Pressed "right arrow", go to next symbol
 jnz inf ;;Almost infinite loop loops almost infinite

 re: ;;It's time to print next symbol or stop roulette
 cmp bx, 6
 jnz le

 ret ;;Fin
    
Post 04 Oct 2011, 16:08
View user's profile Send private message Reply with quote
Goplat



Joined: 15 Sep 2006
Posts: 181
Goplat 04 Oct 2011, 20:16
sourcerer wrote:
You need DOS or Dosbox of NTVDM, but for third game you should use 8086 Very Happy
The 8086 didn't have a "push immediate" instruction, that was introduced in the 80186 :p
Post 04 Oct 2011, 20:16
View user's profile Send private message Reply with quote
sourcerer



Joined: 06 Apr 2011
Posts: 4
sourcerer 05 Oct 2011, 12:03
Ow Very Happy I didn't knew that.
Post 05 Oct 2011, 12:03
View user's profile Send private message Reply with quote
addes3



Joined: 09 May 2011
Posts: 29
addes3 05 Oct 2011, 23:50
Obviously wasn't tested on a 8086 Smile
Post 05 Oct 2011, 23:50
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.