Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the problem is likely to be related to the origin specified.</p> <pre><code>[ORG 0x7C00] ;Origin, tell the assembler that where the code will </code></pre> <p>Based on the conversation we've been having it appears that the address isn't as predicted in some way. It might simply that DS the data segment register is not what you expect. You might actually be able to get the original listing from the web page to work by adding a push and pop of ds before the call to display the string like this,</p> <pre><code> push cs pop ds </code></pre> <p>If not the following code works. </p> <pre><code> [ORG 0x000] ; switched to 0 since we are going to try to correct it ourself call nextinstruction nextinstruction: ; get the return address of the call into dx pop dx ; which is essentially the start of the code + 3 (3 bytes for the call instruction) MOV SI, HelloString ;Store string pointer to SI add si, dx ; add IP from start of program sub si, 3 ; subtract the 3 the call instruction probably took push cs pop ds ; make ds the same as cs. CALL PrintString ;Call print string procedure JMP $ ;Infinite loop, hang it here. </code></pre> <p>This code figures out the offset at runtime of the code being run and also makes sure DS is point to the same segment. Unless otherwise noted instructions involving SI generally also use DS as their code segment to reference the memory.</p> <p>DS is a segment register and you might want to read something like the <a href="http://homepage.mac.com/randyhyde/webster.cs.ucr.edu/www.artofasm.com/index.html" rel="nofollow noreferrer">Art of Assembly</a> to learn more.</p> <p>Earlz is also doing the same sort of thing, just making sure the registers are correct so that the memory address is referenced correctly. It's just he knows more about the boot sector specifics than me.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload