flat assembler
Message board for the users of flat assembler.

Index > OS Construction > RainbowSnakeOS - boot sector snake video game

Author
Thread Post new topic Reply to topic
Palma3000



Joined: 16 Dec 2023
Posts: 3
Location: Ukraine
Palma3000 16 Dec 2023, 19:57
RainbowSnakeOS, a 512 byte OS and snake video game written in 16-bit x86 assembly language (FASM). It can be run from boot sector and MS DOS as .com application.

source code


Description: source code
Download
Filename: rainbowsnakeos-main.zip
Filesize: 7.95 KB
Downloaded: 322 Time(s)



Last edited by Palma3000 on 17 Dec 2023, 11:34; edited 1 time in total
Post 16 Dec 2023, 19:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 17 Dec 2023, 10:57
gitlab requires JS to see anything.

Please post the code here as an attachment.
Post 17 Dec 2023, 10:57
View user's profile Send private message Visit poster's website Reply with quote
Palma3000



Joined: 16 Dec 2023
Posts: 3
Location: Ukraine
Palma3000 17 Dec 2023, 11:35
Done
Post 17 Dec 2023, 11:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 17 Dec 2023, 13:41
Thanks.

BTW: You can eliminate the extra 'struct.inc' file by changing the VARS definition to this:
Code:
struc VARS {
  .len rw 1
  .coords rw SNAKE_MAX_LENGTH
  .food rw 1
  .state rb 1
  .res rb 1
}
virtual at 0
        VARS VARS
        sizeof.VARS = $
end virtual    
Post 17 Dec 2023, 13:41
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2564
Furs 17 Dec 2023, 18:06
Gonna put it on my boot manager's options… Wink
Post 17 Dec 2023, 18:06
View user's profile Send private message Reply with quote
Palma3000



Joined: 16 Dec 2023
Posts: 3
Location: Ukraine
Palma3000 17 Dec 2023, 19:39
revolution
Thank you. I will read more about FASM macroses.

Furs
It`s great.
Post 17 Dec 2023, 19:39
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 18 Dec 2023, 11:21
Code:
struc VARS {
  .len rw 1
  .coords rw SNAKE_MAX_LENGTH
  .food rw 1
  .state rb 1
  .res rb 1
}
virtual at 0
        VARS VARS
        sizeof.VARS = $
end virtual  
;in code
mov [VARS.state],1
mov [eax+VARS.state],1
    


IDA pro show:
Code:
mov     large byte ptr ds:2Ch, 1 ;size 7 bytes
mov     byte ptr [eax+2Ch], 1 ;ok 4 bytes
    
Post 18 Dec 2023, 11:21
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1041
Location: Russia
macomics 18 Dec 2023, 15:31
Quote:
IDA pro show:
Code:
mov     large byte ptr ds:2Ch, 1 ;size 7 bytes
mov     byte ptr [eax+2Ch], 1 ;ok 4 bytes    

Code:
virtual at eax ; 0
        VARS VARS
        sizeof.VARS = $
end virtual    
Post 18 Dec 2023, 15:31
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 18 Dec 2023, 15:47
Code:
virtual at eax ; 0
        VARS VARS
        sizeof.VARS = $
end virtual     


sizeof.VARS = $ ;fasmw 1.73 error invalid value
Post 18 Dec 2023, 15:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 18 Dec 2023, 16:13
Code:
sizeof.VARS = $ - $$    
Post 18 Dec 2023, 16:13
View user's profile Send private message Visit poster's website 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.