In the following code
MOV AL,NUMBER1 ADD AL,NUMBER2 MOV AH, 00H ADC AH, 00H
for which lines 3 and 4? What are they doing?
Also, why does the code clear AH? (I assume that the AL "ADD" operation may result in a carryover.)
To understand this, start by looking at what each instruction does:
MOV AH, 00H
This command will set the register to 0 without affecting the flags. MOVAH
MOV
AH
ADC AH, 00H
This command will add the source operand (0), the carry flag (CF), and the destination operand ( ), storing the result in the destination operand ( ). ADCAHAH
ADC
It is symbolic that then: AH = AH + 0 + CF
AH = AH + 0 + CF
, MOV , CF, ADC, ADD ( 2).
ADD
, AH 0 , : AH = CF.
AH = CF
, :
NUMBER1 AL: AL = NUMBER1
NUMBER1
AL
AL = NUMBER1
NUMBER2 AL: AL = NUMBER1 + NUMBER2
NUMBER2
AL = NUMBER1 + NUMBER2
AH: AH = 0
AH = 0
AH CF, NUMBER1 NUMBER2. , AH 1, , 0 . (AH = CF)
, 16- 8- . -C :
BYTE NUMBER1; BYTE NUMBER2; WORD RESULT = (WORD)NUMBER1 + (WORD)NUMBER2;
BYTE WORD . ? , . 8- , , 8 .
, AL AH , , AX. , AX. 16- NUMBER1 NUMBER2.
AX
Source: https://habr.com/ru/post/1679228/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1679223/counting-the-number-of-hits-to-my-webpage&usg=ALkJrhi0fc5lGwFkDUWbiJmWykDbd49-4AQuery performance: single column and multiple columns - sqlHow can I implement Stateful Builder with CustomOperations and some with f #Determine how many times a webpage has been accessed - javascript% ~ in REM expression - windowsHow to handle installed NPM libraries from web pages and templates? - javascriptWhat is the cleanest thread binding method working in Ruby? - ruby | fooobar.comhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1679231/how-can-i-count-the-number-of-the-visitors-on-my-website-using-javascript&usg=ALkJrhhxw0YQx4e9mHDlZ-NATZ70lv1BCAinitialScrollIndex not working for FlatList - react-nativeHow to limit VHDL-2008 integer_vector? - vhdlAll Articles