32-bit masm code:
Code: Select all
.386P
TEXT segment para use32 public 'CODE'
assume cs:TEXT, ds:nothing, es:nothing, ss:nothing
Start:
xor ax, ax
xor bx, bx
push 07C0h
push @F
retf
@@:
mov ax, cs
mov ds, ax
mov es, ax
TEXT ends
End Start
but use bochs to debug it, the disassembling code is :
Code: Select all
<bochs:3> u /10
00007c00: ( ): xor eax, eax ; 6633c0
00007c03: ( ): xor ebx, ebx ; 6633db
00007c06: ( ): push 0x07c0 ; 68c007
00007c09: ( ): add byte ptr ds:[bx+si], al ; 0000
00007c0b: ( ): push 0x0011 ; 681100
00007c0e: ( ): add byte ptr ds:[bx+si], al ; 0000
00007c10: ( ): retf ; cb
00007c11: ( ): mov ax, cs ; 668cc8
00007c14: ( ): mov ds, ax ; 668ed8
00007c17: ( ): mov es, ax ; 668ec0
bochs can't support 32-bit masm routine?
I change use32 to use16, it will be ok.