Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Can anyone help !

ajtr211ajtr211 Member Posts: 31
[b][red]This message was edited by ajtr211 at 2002-9-13 22:20:50[/red][/b][hr]
Hi All,
This is an instruction from an
example program can anyone explain
the output from the debugger?

.data
var1 SBYTE -4,-2,3,1
var2 WORD 1000h,2000h,3000h,4000h
var3 SWORD -16,-42
var4 DWORD 1,2,3,4,5

;What will be the value of the destination
;operand after each of the following
;instructions executes in sequence?

mov ax,var2 ;a answer 1000h
mov ax,var2+4 ;b answer 3000h
mov ax,var3 ;c answer FFF0h
mov ax,var3-2 ;d answer 4000h

Can someone explain how question 'd'
is worked out by the debugger for it to
equal 4000h inside AX

Thanks in ad John







Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : [b][red]This message was edited by ajtr211 at 2002-9-13 22:20:50[/red][/b][hr]
    : Hi All,
    : This is an instruction from an
    : example program can anyone explain
    : the output from the debugger?
    :
    : .data
    : var1 SBYTE -4,-2,3,1
    : var2 WORD 1000h,2000h,3000h,4000h
    : var3 SWORD -16,-42
    : var4 DWORD 1,2,3,4,5
    :
    : ;What will be the value of the destination
    : ;operand after each of the following
    : ;instructions executes in sequence?
    :
    : mov ax,var2 ;a answer 1000h
    : mov ax,var2+4 ;b answer 3000h
    : mov ax,var3 ;c answer FFF0h
    : mov ax,var3-2 ;d answer 4000h
    :
    : Can someone explain how question 'd'
    : is worked out by the debugger for it to
    : equal 4000h inside AX
    :
    : Thanks in ad John

    [blue]The values +4 and -2 are address offsets. If you take an address of 'var3' and move it back 2 bytes you point to the value of 4000h.[/blue]
  • ajtr211ajtr211 Member Posts: 31
    : : [b][red]This message was edited by ajtr211 at 2002-9-13 22:20:50[/red][/b][hr]
    : : Hi All,
    : : This is an instruction from an
    : : example program can anyone explain
    : : the output from the debugger?
    : :
    : : .data
    : : var1 SBYTE -4,-2,3,1
    : : var2 WORD 1000h,2000h,3000h,4000h
    : : var3 SWORD -16,-42
    : : var4 DWORD 1,2,3,4,5
    : :
    : : ;What will be the value of the destination
    : : ;operand after each of the following
    : : ;instructions executes in sequence?
    : :
    : : mov ax,var2 ;a answer 1000h
    : : mov ax,var2+4 ;b answer 3000h
    : : mov ax,var3 ;c answer FFF0h
    : : mov ax,var3-2 ;d answer 4000h
    : :
    : : Can someone explain how question 'd'
    : : is worked out by the debugger for it to
    : : equal 4000h inside AX
    : :
    : : Thanks in ad John
    :
    : [blue]The values +4 and -2 are address offsets. If you take an address of 'var3' and move it back 2 bytes you point to the value of 4000h.[/blue]
    :
    Hi AsmGuru62
    Thanks !
    John ajtr211
  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    _______ ( http://forcoder.org ) free video tutorials and ebooks about [ Perl, C, PHP, Delphi, Java, Assembly, Swift, JavaScript, Objective-C, Visual Basic .NET, R, Ruby, Python, Visual Basic, C#, MATLAB, PL/SQL, C++, Go, Scratch Awk, Lua, Hack, Logo, Scheme, Rust, D, Scala, Crystal, Kotlin, Bash, LabVIEW, F#, Prolog, Erlang, Apex, Fortran, Dart, FoxPro, Transact-SQL, Ada, ABAP, SAS, Clojure, COBOL, Alice, Julia, Lisp, VBScript, ML ] ___

Sign In or Register to comment.