如何告诉GCC生成16位code实模式 [英] How to tell GCC to generate 16-bit code for real mode

查看:504
本文介绍了如何告诉GCC生成16位code实模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写实模式功能,这应该与stackframes等正常功能,但它应该使用ESP%SP代替%。是否有某种方式做到这一点?

I am writing real mode function, which should be normal function with stackframes and so, but it should use %sp instead of %esp. Is there some way to do it?

推荐答案

据我所知,GCC不支持代code的16位x86。对于传统的引导程序和类似用途的,你应该用汇编语言编写一个小存根将CPU的32位模式,并通过关闭运行到32位code。对于其他的目的,你真的不应该写16位code。

As far as I know, GCC does not support generation of code for 16-bit x86. For legacy bootloaders and similar purposes, you should write a small stub in assembly language to put the cpu in 32-bit mode and pass off execution to 32-bit code. For other purposes you really shouldn't be writing 16-bit code.

这篇关于如何告诉GCC生成16位code实模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆