내 PC에 파티션 디스크를 보여주는 부팅 프로그램을 만드는이 과제가 있습니다. 나는 많은 것을 검색하여 1BE에서 정보를 유출 한 섹션을 읽었습니다. 부문 .. 난 몇 가지 코드를 발견하고 13이 코드 인터럽트 연구하기 위해 노력하고 내가 NASM 그것을 실행할 때 나는 오류 알 수없는 지시문 ORG를 보였다 그때디스크 파티션 부팅
문제가있는 느낌이 모르는
고마워 :) :)
[BITS 16] ; 16 bit code generation
[ORG 0x7C00] ; Origin location
; Main program
main: ; Label for the start of the main program
start:
mov ax,cs
mov ds,ax
mov es,ax
mov ss,ax
sti
reset: mov ah,0h ;resetting the drive to the first sector
mov dl, 0x80
int 13h
js reset
read: mov ax,1BEh ;reading sectors into memory address 0x1BE:0
mov es,ax
xor bx,bx
mov ah,02h
mov al,01h ;reading 1 sector
mov cx, 0001h ; track 0, sector 1
mov dx, 0000h ; head 0, drive 0
int 13h
jc errp ; detect error
ret
jmp $ ; Never ending loop
; Procedures
errp: ; process error here
mov ax,0x0000
mov ds,ax
mov si, ERRR ; Load the string into position for the procedure.
call PutStr
PutStr: ; Procedure label/start
; Set up the registers for the interrupt call
mov ah,0x0E ; The function to display a chacter (teletype)
mov bh,0x00 ; Page number
mov bl,0x07 ; Normal text attribute
.nextchar
lodsb
or al,al
jz .return
int 0x10 ; Run the BIOS video interrupt
jmp .nextchar ; Loop back round tothe top
.return ; Label at the end to jump to when complete
ret ; Return to main program
; Data
ERRR db 'ERROOOORR',13,10,0
; End Matter
times 510-($-$$) db 0
dw 0xAA55
'내 PC'는 시뮬레이션 된 컴퓨터 시스템입니까? –
예 Bochs 사용하기 – Sarah
매뉴얼을 보면 ORG 지시문에 '['와 ']'가 없어야합니다. –