masm - Change the value at an absolute word address -


how perform operations change value @ absolute word address?

say have value @ 5dah , want count number of zeros on address, or move value 1 absolute address another. how can 1 that?

short answer: can't

you might have trick question in front of (no clue, guess).

the physical architecture of 8086 chip did not have instruction.

as 2 specific questions...

"...you want count number of zeros on address..."

that's ambiguous, in fact vague can't understand it.

"...move value 1 absolute address another..."

good question. we'll in 32 bit, no, 16 , 32 bit.

16 bit example

    push    si                      ;source index register     push    di                      ;destination index register     push    ax                      ;we'll use transfer      lea si, where_the_number_is_now ;you'll define this, somehow     lea di, where_we_want_it_to_go  ;you'll define also, same thing      mov ax, ds:[si]                 ;the "ds:" may or may not needed, safe     mov ds:[di], ax                 ;probably need "ds:" instruction      pop ax                          ;do pay attention reverse order     pop di                          ;...of popping registers in exact     pop si                          ;...opposite of how pushed                                      ; , done 

32 bit example

    push    esi                         ;source index register     push    edi                         ;destination index register     push    eax                         ;we'll use transfer      lea esi, where_the_number_is_now    ;you'll define this, somehow     lea edi, where_we_want_it_to_go     ;you'll define also, same thing      mov eax, ds:[esi]                   ;the "ds:" may or may not needed, safe     mov ds:[edi], eax                   ;probably need "ds:" instruction      pop eax                             ;do pay attention reverse order     pop edi                             ;...of popping registers in exact     pop esi                             ;...opposite of how pushed                                          ; , done 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -