hi, I'm a beginner -- just started learning ASM. Anyway, my first program is this:
[code]
[BITS 16] ;Set code generation to 16 bit mode
[ORG 0x0100] ;Set code start address to 0100h
start:
mov ax,0b800h ; VGA video refresh segment
mov es, ax ; move it to ES
xor di,di ; zero out DI to get B800:0000
mov ax,0441h ; code for a red 'A'
mov [es:di],ax ; move the red 'A' to video refresh buffer
; thus we can see red 'A' at top-left in screen
[/code]
after running this code, NASM crashs, and when I try it in DEBUG, I see the red 'A' but cursor starts to jump all over and windows says program cause a fault.
is there any problem with the code itself? I'm running it under DOS within Windows ME.
thanks,
[code]
[BITS 16] ;Set code generation to 16 bit mode
[ORG 0x0100] ;Set code start address to 0100h
start:
mov ax,0b800h ; VGA video refresh segment
mov es, ax ; move it to ES
xor di,di ; zero out DI to get B800:0000
mov ax,0441h ; code for a red 'A'
mov [es:di],ax ; move the red 'A' to video refresh buffer
; thus we can see red 'A' at top-left in screen
[/code]
after running this code, NASM crashs, and when I try it in DEBUG, I see the red 'A' but cursor starts to jump all over and windows says program cause a fault.
is there any problem with the code itself? I'm running it under DOS within Windows ME.
thanks,