Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > can anyone tell...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 4570 of 4646
Post > Topic >>

can anyone tell me why I get an error at line 19 with NASM?

by messianic light <spamtrap@[EMAIL PROTECTED] > Mar 13, 2008 at 08:20 PM

I am not sure about the mul statement and the square brackets - thanks
in advance

	segment .data

X	dw 10
Y	dw 10
Color	db 7
	segment .text
;Change the video mode to 13h
    xor  ah, ah         ;VIDEO Function 00h: Change screen
    mov  al, 13h        ;Put the desired graphics mode into AL
    int  10h            ;Call VIDEO

  ;Prepare for writing to the video buffer
    mov  di, 0a000h     ;Put the video segment into DI
    mov  es, di         ; so it can easily be put into ES
    xor  di, di         ;Start writing at coordinates (0,0)
;Plot a pixel in video mode 13h, where
  ;PixelAddress = (320 * Y) + X
    mov  ax, 320        ; Prepare for the multiplication
    mul  [Y]            ; Assuming that Y is defined in the data
segment HERE IS LINE 19 - PLEASE HELP
                        ;   earlier in the program
    mov  di, ax         ; Put in into the pointer to the offset of ES
    add  di, [X]        ; Assuming that X is defined in the data
segment
                        ;   earlier in the program
    mov  al, [Color]    ; Assuming that Color is defined in the data
                        ;   segment earlier in the program
    stosb               ; Write it to the screen!
    mov ah, 0
	int 16h   ; wait for a key
	mov ax, 3
	int 10h
	ret




 1 Posts in Topic:
can anyone tell me why I get an error at line 19 with NASM?
messianic light <spam  2008-03-13 20:20:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 16:51:54 CDT 2008.