简体   繁体   中英

segmentation fault while trying to run graphics in yasm

I'm trying to learn assembly for x86_64 and the only problem for now is with the VGA graphics. It tells me "Segmentation fault (core dumped) ".

the loop func is to freeze the code.

I've tried a lot of tutorials in the WEB, but none of them helped me.

mov ax, 0x0a000
mov es, ax
mov ah, 00H
mov al, 13H
int 10H

mov ah, 0ch
mov al, 03h
mov cx, 70
mov dx, 70
mov bh, 1
int 10h

jmp _loop 

I expected to draw a pixel.

That's not x86-64 assembly but 16-bit assembly code. If you run this in a 64-bit OS I would expect a segmentation fault.

This code needs to be run in real mode, probably in DOS. Today this probably means to run this code in DOSBOX or a similar emulator, but is should be possible to boot a modern machine to DOS and run this code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM