Hi,
I am learning assembly programming 16 bit. I would like to code the game breakout ( a very simple version ) using it and would like to output messages straight to the video memory, that means i wouldnt use interrupts to output stuff. So far I have this much code. Anyone have any suggestions, tips or maybe even a link to source code that can help me out ??
constants.inc
I am learning assembly programming 16 bit. I would like to code the game breakout ( a very simple version ) using it and would like to output messages straight to the video memory, that means i wouldnt use interrupts to output stuff. So far I have this much code. Anyone have any suggestions, tips or maybe even a link to source code that can help me out ??
Code:
.model small
.586
.stack 100h
.nolist
;*************************************************
;Includes
;*************************************************
include bios.inc
include constants.inc
.list
.data
.code
main proc
.startup
@Cls
@Setcsrpos,0,0
mov ax,0B800h
mov es,ax
mov cx,2
mov ax, 0Fdbh
Loop1:
mov bx,cx
;mov ax,002Dh
mov es:[bx],ax
add cx,2
cmp cx,78
jng Loop1
;initialize everything
;@@:
;get user input
;update paddle
;update ball
;draw the screen
;check if all bricks are gone, if so then quit
;jmp @b
;done:
; @Cls
; @Setcsrpos,0,0
.exit
main endp
end
constants.inc
Code:
VIDSEG equ 0B800h ;video segment address
VIDCOL equ 80 ;video columns
VIDROW equ 25 ;video rows
STARTBRICKY equ 9 ;start row of bricks
STARTBRICKX equ 1 ;start column of bricks
ENDBRICKY equ 10 ;end row of bricks
ENDBRICKX equ 78 ;end column of bricks
CR equ 0Dh ;define CR as carriage return
LF equ 0Ah ;define LF as line feed
FALSE equ 0 ;define FALSE to value 0
TRUE equ 1 ;define TRUE to value 1
STARTX equ 0 ;start column for ball
STARTY equ 21 ;start row for balll
STARTVELY equ 1 ;x velocity of ball
STARTVELX equ 1 ;y velocity of ball
PADDLELEN equ 5 ;length of paddlebar
PADDLEX equ 0 ;start x position of paddle
PADDLEY equ 23 ;start y position of paddle