I have run through the machine code also.. couldn't find anything I did not expect. Also I changed the stack pointer to 0x7c00. I boot using an USB flash drive and on my netbook it prints the A + a square. It seems to be ascii char 0xFE (the last one on your image). BUT if a friend of mine boots it displays just the (green) A. And when I boot with my main machine it prints the A + a newline..
The square is filled whiteish (the white bios interupts use, vid mem white is really white).
Edit:
The strange char being printed can be caused by the fact that I dw the magic word 55aa. And the opcode for stos(w) is.. aa. And since es still points to the vid mem offset it could be possible.. I'll test that now.
stage 1
Code: Select all
ORG 0x7C00
[BITS 16]
_start: ; entry point
jmp 0x0:.flush
.flush:
xor ax, ax
mov ax, cs
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x7C00
mov [bootdisk], dl
.reset:
xor ax, ax
mov dl, [bootdisk]
int 0x13
jc .reset
.read:
mov ah, 0x2
mov al, 1 ; read some sectors
xor cx, cx
mov cl, 2
xor dx, dx
mov dl, [bootdisk]
; setup buffer
xor bx, bx
mov es, bx
mov bx, 0x7e00
int 0x13
jc .read
test ah, ah
jnz .reset
cmp al, 0x1
jne .reset
mov ax, 0b800h
mov es, ax
xor di, di
mov al, 65
mov ah, 0xc
stosw
jmp 0x0:0x7e00
bootdisk db 0
times 510 - ($ - $$) db 0
dw 0xAA55
Stage 2
Code: Select all
ORG 0x7E00
[BITS 16]
stage2:
mov ax, 0xb800
mov es, ax
xor di, di
mov al, 69
mov ah, 0xc
stosw
jmp $
times 512 - ($ - $$) db 0