I learn to assembler yasm. But when compiling displays:

boot.asm: 11: warning: value does not fit in 8 bit field

Source:

use16 org 0x7c00 start: mov ah,0xEH mov al "This is working..." mov bl,0 mov bh,0 int 10h jmp $ finish: times 510+start-finish db 0 db 0x55,0xAAA 
  • You missed your dog mov al "This is working" - Alexander Chernin
  • Already set, now boot.asm: 4: error: expected `, 'boot.asm: 10: warning: value 8 bit field - Marlin AK
  • It seems that you cannot pass the address of the string through mov al "String" ... Try setting the string separately, such as str db "this is working", 0x0d, 0x0a, '$', and then do mov al, str Here you can see montcs. bloomu.edu/Information/LowLevel/Assembly/hello-asm.html - Alexander Chernin

1 answer 1

You have the error, not "in the assembler yasm". After typo correction:

 mov al, "This is working..." 

What is meant? The 0Eh function prints a character, not a string. You need to loop, sequentially, put the characters of the string in al and output them one by one. something like this (I write blindly, the idea itself):

 my_string db "This is working..." string_length = $ - offset my_string ; ... cld mov si, offset my_string mov cx, string_length next_char: lodsb mov ah, 0Eh ; в bx - нужные атрибуты int 10h loop next_char