I'm a first-timer here, and looking forward to some interesting discussions!
I've just been poking around with the "Hello world" bootloader from the "Bona Fide OS development" site, and am trying to display more than one string. ( I managed to assemble and run the one-string version with no problems).
However, when I try to run the code below, I get the error -
"hello_world_bootloader.txt:44: error: comma or end of line expected
Puzzling, as the string has the usual 13,10,0 at the end of it. Anyway, here is the code -
Code: Select all
[BITS 16] ; 16 bit code generation
[ORG 0x7C00] ; Origin location
; Main program
main: ; Label for the start of the main program
mov ax,0x0000 ; Setup the Data Segment register
; Location of data is DS:Offset
mov ds,ax ; This can not be loaded directly it has to be in two steps.
; 'mov ds, 0x0000' will NOT work due to limitations on the CPU
mov si, HelloWorld ; Load the string into position for the procedure.
call PutStr ; Call/start the procedure
mov si, Test ; Load another string
call PutStr ; Print string
jmp $ ; Never ending loop
; Procedures
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 ; Internal label (needed to loop round for the next character)
lodsb ; I think of this as LOaD String Block
; (Not sure if thats the real meaning though)
; Loads [SI] into AL and increases SI by one
; Check for end of string '0'
or al,al ; Sets the zero flag if al = 0
; (OR outputs 0's where there is a zero bit in the register)
jz .return ; If the zero flag has been set go to the end of the procedure.
; Zero flag gets set when an instruction returns 0 as the answer.
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
HelloWorld db 'Open the pod-bay door, HAL...',13,10,0
Test db 'Another nice long string',13,10,0 ; the error is happening here
; End Matter
times 510-($-$$) db 0 ; Fill the rest with zeros
dw 0xAA55 ; Boot loader signature
So, any help in fixing this so that I can display more than one text string would be great - many thanks in advance....
- mooseman