stuck on vga problem.
Posted: Fri Jun 04, 2004 8:04 am
Im have a bit of trouble with this assembly program,
all it is supposed to do is put the 15 byte values of
"image" into the VGA buffer...but when I fire up bochs,
I get garbage. If I dont use lodsb and load AX manually,
I get the correct output. any help? also, im confused as to
what $ does when used with labels. At&t syntax doesnt seem
to have brackets like nasm/tasm/masm.
.org 0x0,0x0
.code16
.globl _start
_start:
movw $0x13,%ax
int $0x10
push $0x0A000
pop %es
xor %di,%di
mov image,%si
movw $15,%cx
write_loop:
lodsb
stosb
loop write_loop
halt:
jmp halt
image: .byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1
.org 510,0
.byte 0x55,0xAA
all it is supposed to do is put the 15 byte values of
"image" into the VGA buffer...but when I fire up bochs,
I get garbage. If I dont use lodsb and load AX manually,
I get the correct output. any help? also, im confused as to
what $ does when used with labels. At&t syntax doesnt seem
to have brackets like nasm/tasm/masm.
.org 0x0,0x0
.code16
.globl _start
_start:
movw $0x13,%ax
int $0x10
push $0x0A000
pop %es
xor %di,%di
mov image,%si
movw $15,%cx
write_loop:
lodsb
stosb
loop write_loop
halt:
jmp halt
image: .byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1
.org 510,0
.byte 0x55,0xAA