Hi,
I was looking at this tutorial:

http://linuxgazette.net/77/krishnakumar.html

There's an instruction there that says "seg es", my question is whats this instruction in AT&T style? I'm trying to rewrite the code in AT&T syntax and use it with gcc/ld but it gives me an error: "kernel.s:6: Error: no such instruction: `seg %es'"

Any help appreciated!

Best regards,
Keith

Recommended Answers

All 3 Replies

Hi,
I was looking at this tutorial:

http://linuxgazette.net/77/krishnakumar.html

There's an instruction there that says "seg es", my question is whats this instruction in AT&T style? I'm trying to rewrite the code in AT&T syntax and use it with gcc/ld but it gives me an error: "kernel.s:6: Error: no such instruction: `seg %es'"

Any help appreciated!

Best regards,
Keith

I won't go by that syntax if you using GCC/AS..

This about the same thing

.code16

.section .data

.scetion .text
	.global _start
_start:
			movw	$0xb800, %ax
			movw	%ax, %es

			movb	$0x41, %es:0
			movb	$0x1f, %es:1

			movb	$0x34, %es:2
			movb	$0x1f, %es:3

			movb	$0x31, %es:4
			movb	$0x1f, %es:5

			movb	$0x34, %es:6
			movb	$0x1f, %es:7

			movb	$0x33, %es:8
			movb	$0x1f, %es:9
loop1:
			jmp	loop1
commented: Thanks, exactly what I needed. +0

Thanks a lot Gerard for your help.

Just one question, how do I compile it?

I tried gcc kernel.s -c -o boot.o
Then: ld86 boot.o -o boot

But that tells me there's a "bad magic number". When I looked at the man page for ld86 it told me that it can only understand .o files produced by as86 but as86 won't accept AT&T syntax...

Sorry for the newbie questions.

Thanks again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.