Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Troogroove

macrumors newbie
Original poster
Mar 11, 2015
2
0
Does anyone know how I can convert the following code so I can Assemble it using MASM

mov ax, 0x13
int 10h

The above is changing the screen mode but if I add a syscall function I get a Segmentation Fault 11 i am not sure which call i should be using:

mov rax, 0x2000004

exit

mov rax, 0x2000001

Once i change the screen mode I want to write to the screen a single pixel to the screen
 
int 10h is an interrupt for the REAL MODE through BIOS' IDT. It is not a supported interrupt in protected mode operating systems like macOS where only syscalls provide allowed functionality through hardware abstraction. You can't take direct control of the system's frame buffer or anything like that like this; This is not exclusive to macOS. It would similarly fail on Linux.

You can write to your file descriptor 1 to print to the stdout in a similar way to your mov rax, 0x2000004 sys call, but you cannot write to a single pixel in the frame buffer this way
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.