I have recently switched from masm to nasm and my code I wrote in masm no longer works so i'm trying to recreate it in nasm. My code for masm was:
.model small
.stack
.data
.code
AppMain:
mov ax, 13h
int 10h
mov ax, a000h
mov es, ax
WriteGraphics:
mov ah, 2
mov di, cx
mov cx, 64000
FillScreen:
mov es:[di], ah
add di, 1
cmp di, cx
jb FillScreen
end AppMain
This would simply fill the screen with green.
Since It no longer works I tryed it in nasm, by writing this:
[BITS 16]
[ORG 0x7c00]
AppMain:
mov ax, 00a000h
mov es, ax
mov ah, 1
mov di, 0
FillScreen:
mov dx, es ;___________
add dx, di ; these three instructions used to be "mov es:[di], ah", I changed it because it got an error, Still doesn't work though.
mov [dx], ah ;____________
add di, 1
cmp di, 64000
jb FillScreen
times 510-($-$$) db 0x00
dw 0xaa55
Using this with nasm I got errors what is wrong with it?