두 번째 단계는 13h (320x200) 비디오 모드를 사용하는 2 단계 부트 로더를 만듭니다. 이중 버퍼를 비디오 메모리에 복사하는 간단한 기능을 시작하기로 결정했지만 문제는 없습니다. 복사, 코드 수 : (하지만 난 메모리에 메모리를 필요로) 다음 코드는 일을 happens.Although이 코드는 빨간색으로 비디오 메모리의 첫 번째 400 바이트를 작성해야Assembly x86 movsb
org 0x7E00
xor ax, ax
mov ds, ax
jmp begin
foo: times 400 db 5
govideo:
mov ah, 0
mov al, 13h
int 10h
ret
begin:
call govideo
mov ax, 0xa000 ; video memory address
mov es, ax ; es,address to receive
mov di, 0x0 ; no offset
mov ax, foo ; foo,the test double buffer,all bytes initialized with 5(red color)
mov ds, ax ; ds,address to copy
mov si, 0x0 ; no offset
mov cx, 400 ; all foo 400 bytes
cld ; clear direction flag,so es and ds get incremented
rep movsb ; copy all 400 bytes
terminate:
times 510-($-$$) db 0
, 아무것도하지만,
mov ax, 0xa000
mov es, ax
mov al, 5
mov cx, 400
cld
rep stosb
첫 번째 스 니펫이 작동하지 않는 이유는 무엇입니까? 사전
편집 2
감사 : 직접 Si 및 디하기 위해 이동 : 당신은 세그먼트 레지스터에 직접 foo는의 주소를 이동하는
xor ax, ax
mov es, ax
mov ds, ax
mov di, 0xa000
mov si, foo
mov cx, 400
cld
rep movsb
'mov ax, seg foo'를 사용하셨습니까? – Michael
@ 마이클 나는 당신이 의미하는 것을 이해하지 못했습니다! – Mateus
현재'mov ax, foo' /'mov ds, ax'를하고 있는데'ds'에'foo'의 _offset을 넣을 것입니다. 'foo'의 _segment_를 원한다고 생각합니다. 그러므로'seg foo '를 사용하라는 제안. – Michael