Closed Ringdingcoder closed 1 year ago
If you want to generate proper 16bit effective addresses you can use:
option flat:1
.code
USE16
mov edx, [bp+8]
or using traditional segment notation:
.model flat
mycode segment para public use16 'code'
assume cs:mycode
mov edx, [bp+8]
mycode ends
.code simplified directives are really only for 32bit+
I actually wanted to generate 32 bit code to see if it works. In other assemblers, it does. The correct binary code would be 678B5608.
Ah ok, I'll look into that then.
Out of curiosity, is there an actual use-case for this, or more just because you should be able to ?
Fixed in 2.56
Use case, meaning that the assembled code needs to do something useful, no. But meaning, the assembler can be used as a tool for experimentation, absolutely ;). Investigating interesting behavior tends to get harder with the amount of misbehaving links in the chain.
Got it 😊 Well it’s all sorted now, if you want to try and let me know then we can close this ticket.
From: Stefan Ring @.> Sent: Wednesday, November 2, 2022 12:09 PM To: Terraspace/UASM @.> Cc: John Hankinson @.>; Comment @.> Subject: Re: [Terraspace/UASM] Instruction encoding with address size override prefix is wrong (Issue #172)
Use case, meaning that the assembled code needs to do something useful, no. But meaning, the assembler can be used as a tool for experimentation, absolutely ;). Investigating interesting behavior tends to get harder with the amount of misbehaving links in the chain.
— Reply to this email directly, view it on GitHub https://github.com/Terraspace/UASM/issues/172#issuecomment-1300240948 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAZAVCLXEEMH2OGZSEGZSLWGJKWLANCNFSM5USRB67A . You are receiving this because you commented.Message ID: @.***>
I verified that this is fixed.
The following file, when built with
uasm -3 -bin -Fl
will generate this listing:
But disassembly of the generated binary gives
which is obviously something very different.