You are on page 1of 3

; ================================================================ ; ===== 99snake.

asm ============================================== ; ===== Snake and Maze ===========================================

Start: MOV OUT AL,FF 04 ; Reset the maze ; Send control data to port 04

MOV OUT OUT OUT OUT OUT OUT OUT OUT OUT OUT

AL,4F ; 2 means left. 7 distance units 04 04 04 04 04 04 04 04 04 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04

MOV OUT OUT OUT

AL,1F ; 4 means down. Down 15 units. 04 04 04 ; Send control data to port 04 ; Do it twice to move further ; Send control data to port 04

MOV OUT OUT OUT OUT OUT

AL,8F ; 8 means up. 15 distance units. 04 04 04 04 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04

MOV OUT OUT

AL,1F ; 2 means left. 7 distance units 04 04 ; Send control data to port 04 ; Send control data to port 04

MOV OUT OUT OUT OUT OUT

AL,4F ; 2 means left. 7 distance units 04 04 04 04 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04

MOV OUT OUT OUT

AL,1F ; 4 means down. Down 15 units. 04 04 04 ; Send control data to port 04 ; Do it twice to move further ; Send control data to port 04

MOV OUT OUT OUT OUT OUT OUT OUT

AL,8F ; 8 means up. 15 distance units. 04 04 04 04 04 04 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04

MOV OUT OUT OUT OUT

AL,2F ; 8 means up. 15 distance units. 04 04 04 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04

OUT

04

; Send control data to port 04

MOV OUT OUT OUT

AL,8F ; 8 means up. 15 distance units. 04 04 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04

MOV OUT OUT OUT

AL,1F ; 4 means down. Down 15 units. 04 04 04 ; Send control data to port 04 ; Send control data to port 04 ; Send control data to port 04

JMP END

Start

; Repeat the whole sequence

; ================================================================

You might also like