Reputation: 19
I have error in line 13 called "Comma, colon or end of line expected". I want to write a program that's gonna write ascii heart at the X, Y possitions. As you can see i use pattern
(Y*80+X)*2
org 100h
MOV AX,0A000H
MOV ES,AX
MOV AX,poz_y
MOV BX,80
MUL BX
ADD AX,poz_x
MOV BX,2
MUL BX
MOV DI,AX
MOV AL,9825
MOV BYTE PTR ES:[DI],AL
poz_x dw 160
poz_y dw 100
NOW:
Thanks to you all for your response :) Now Im trying to display ASCII character at this point, its compiling but doesnt do anything:
org 100h
MOV AX,0b800h
MOV ES,AX
MOV AX,poz_y
MOV BX,80
MUL BX
ADD AX,poz_x
MOV BX,2
MUL BX
MOV DI,AX
MOV [ES:DI], word 2d04h
mov ax, 0x4c00
int 21h
poz_x dw 160
poz_y dw 100
Upvotes: 1
Views: 896
Reputation: 19
Thanks for help :)
org 100h
MOV AX,0b800h
MOV ES,AX
MOV AX,poz_y
MOV BX,80
MUL BX
ADD AX,poz_x
MOV BX,2
MUL BX
MOV DI,AX
MOV [ES:DI], word 2d04h
mov ax, 0x4c00
int 21h
poz_x dw 160
poz_y dw 100
Upvotes: 0
Reputation: 2952
The PTR
operator is only used in MASM.
NASM doesn't use it, so in order to assemble your code, you will need to remove it:
MOV AX,0A000H
MOV ES,AX
MOV AX,poz_y
MOV BX,80
MUL BX
ADD AX,poz_x
MOV BX,2
MUL BX
MOV DI,AX
MOV AL,9825
MOV BYTE [ES:DI],AL ; ← change this line
poz_x dw 160
poz_y dw 100
Note that the BYTE
isn't actually needed here—the assembler can tell that you're storing a BYTE-sized value, since the source register is the BYTE-sized AL
. However, it doesn't hurt to include it.
Upvotes: 1