flat assembler
Message board for the users of flat assembler.

Index > DOS > Can you play this game?

Author
Thread Post new topic Reply to topic
eskizo



Joined: 22 Nov 2005
Posts: 59
eskizo 02 Jul 2009, 05:54
This is an old game I tried to remake. Its based on 'answer fisrt, ask later'. Read the code and try to play it. Afterall call a dumb friend and try to make him sufer for a while Wink

good luck.

Code:
;
; Ghost game
;

define HIDE ','
define SHOW '.'
define CR 13
define LF 10
define BUFFLEN (buff - mask)

org 0x100

        mov dx, title   ;
        mov ah, 0x9     ; displays welcome text
        int 0x21        ;
begin:  mov di, buff    ; destination_index = buff;
        and ax, 0x0     ; get char
        int 0x16        ;
        cmp al, 0x1B    ; if char == ESC then
        je done         ; exit
        cmp al, HIDE    ; if char == HIDE then
        je @f           ; play the game!
        mov ah, 0x2     ;
        mov dl, al      ; else display char,
        int 0x21        ;
        jmp begin       ; and try again
@@:     and ax, 0x0     ; get char
        int 0x16        ;
        cmp al, 0x1B    ; if char == ESC then
        je done         ; exit
        cmp al, SHOW    ; if char == SHOW
        je @f           ; goto last part
        stosb           ; store char to answer buff
        mov ah, 0x2     ; and show the false typed char
        mov dl, [di-BUFFLEN-1]
        int 0x21        ; from mask (di previously incremented)
        jmp @b          ; until SHOW command
@@:     and ax, 0x0     ; last part
        int 0x16        ; get char
        mov ah, 0x2     ;
        mov dl, al      ; and show
        int 0x21        ;
        cmp al, 0x1B    ; if char == ESC then
        je done         ; exit
        cmp al, CR      ; if char != CR then
        jne @b          ; get another char
        mov dl, LF      ; make next line
        int 0x21        ; and put '$' to mark the end of answer
        mov byte [di], '$'
        mov dx, buff    ;
        mov ah, 0x9     ; show the answer
        int 0x21        ;
        mov ah, 0x2     ;
        mov dl, CR      ;
        int 0x21        ;
        mov dl, LF      ; make next line
        int 0x21        ;
        jmp begin       ;
done:   mov ax, 0x4C00  ; good bye!
        int 0x21        ;

        title db 'Welcome to ghost game!', 13, 10, 'Type you question:', 13, 10, 13, 10, '$'
        mask db 'Hello weird being, could you tell me '
        buff rb BUFFLEN    
Post 02 Jul 2009, 05:54
View user's profile Send private message Reply with quote
eskizo



Joined: 22 Nov 2005
Posts: 59
eskizo 03 Jul 2009, 14:27
Ok. How to do it:

1- exec the binary;
2- type exactly: ,fasm.o ghost, whats the best assembler you know? [enter]
3- now you see the answer.

You got the idea?
Post 03 Jul 2009, 14:27
View user's profile Send private message Reply with quote
nop



Joined: 01 Sep 2008
Posts: 165
Location: right here left there
nop 04 Jul 2009, 05:28
eskizo wrote:
Ok. How to do it:

1- exec the binary;
2- type exactly: ,fasm.o ghost, whats the best assembler you know? [enter]
3- now you see the answer.

You got the idea?
um i think i got it and
,no definitely not.o ghost, do i want to play this game? [enter] Wink
Post 04 Jul 2009, 05:28
View user's profile Send private message Reply with quote
eskizo



Joined: 22 Nov 2005
Posts: 59
eskizo 04 Jul 2009, 08:44
Rolling Eyes
Post 04 Jul 2009, 08:44
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.