Home > other >  Consult, Wang Shuang example "assembly language" of the book.
Consult, Wang Shuang example "assembly language" of the book.

Time:05-27

Code is as follows, do I understand, but this topic ask ax and last what is the value of bx, what other information is not to give, if can't calculate,
Such as mov word PTR ss: [0], offset s this is put s label position offset in the ss: [0] memory, but what is the offset s label didn't say, I don't know each other what is the machine code instruction, the problem can not be done,

 assume cs: code 
The data segment
Dw 8 dup (0)
The data ends
Code segment
Start: mov ax, data
Mov as, ax
Mov sp, 16
Mov word PTR ss: [0], offset s
Mov ss: [2], cs
Call dword PTR ss: [0]
The nop
S: mov ax, offset s
Sub ax, ss: ch [0]
Mov bx, cs
Sub bx, ss: eh [0]
Mov ax, 4 c00h
Int 21 h
Code ends
The end start

CodePudding user response:

Because no org to specify the starting address, code segment 0 is the default start address offset, s address order available

CodePudding user response:

reference 1/f, play big shoot early nuclear response:
because no org to specify the starting address, code segment 0 is the default start address offset, s address order available

S, please address how to order available?

CodePudding user response:

This topic is not so understand, S address there is no relationship; What's the final ax, bx, s: is the complete address and ss: [0-0 f] c content is presupposed, ss: [0 c - 0 f] is what should be the call dword... Instruction to form the return address, return address is where, is that the nop instruction address, the result is not the length of the nop instruction?