Need a little help with my assembly code

Trying to code a 32-bit Boolean calculator, it assembles and runs and everything. But when I try to OR two 32-bit numbers together for example, I keep getting 00000000. Can you find my error logic please?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
OR_op PROC
;
; Prompts user to enter two hexadecimal values. ORs
; them together and displays the sum in Hex.
;
;Receives: Nothing
;--------------------------------------------------

mov edx, OFFSET firstHex
call WriteString
call Crlf

call ReadHex
mov eax, firstNum

mov edx, OFFSET secondHex
call WriteString
call Crlf

call ReadHex
mov eax, secondNum
or eax, eax
call WriteHex
call Crlf

ret

OR_op ENDP
Last edited on
First of all you are loading firstNum and secondNum in the same register eax. So secondNum overwrites firstNum. I do not see any sense in this operation. Also it is not clear what is the relation between for example firstHex and firstNum.
How is this related to C++?
@AbstractionAnon

How is this related to C++?


It has a direct relation with C++ because 1) object code of C++ is an assembler code and 2) you should be able to debug your code on the level of the object code.
Assembler code is still source code. It remains for that to be translated into object code as an additional process.
Topic archived. No new replies allowed.