[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

off topic - Assembler using GCC



Sorry again for the off-topic post - I've made what I think is quite a lot
of progress in as much as I can now get the asssembler compiled and
sometimes running.

However I am stuck now on implementing interrupts - specifically int 0x10.

Everytime I run this code I get a segmentation fault error.  I have tracked
the problem down to the int $0x10 instruction but why is this causing a
problem ???

Any and all help gratefully received.

Ivan.

The test code as follows :

.globl main
main:
	mov	$0x00, %ah
	mov	$0x13, %al	# set 320 x 200, 256K
	int	$0x10		# call bios
	call	loop
	mov	$0x00, %ah
	mov	$0x02, %al	# set 80 x 25, 8 x 14 box, 16 colours
	int	$0x10		# call bios
	ret

# loop is a simple delay function
.globl loop
loop:
	mov	$0x0fff, %ebx
.L2:
	mov	$0xffff, %eax
.L3:
	sub	$1, %eax
	jnz	.L3
	sub	$1, %ebx
	jnz	.L2
	ret


Reply to: