PDA

View Full Version : about assembly


pikolo543
05-07-2003, 02:30 AM
hi there

please help me about assembly, how can i use numeric operators and string, characters, decimal numbers converstion. how can i do this in assembly. like this



declaration of variable A is Decimal, B is Decimal, C is Decimal
the coding the
" ' " is a comment

A = 1
B = 2

C = A * B 'Mutiply A to B and assign to C

Print C ' print it to the screen , the valu of C must be 2

Jason
05-07-2003, 02:37 AM
can't entirely remember but its something like:

assembly uses registers and there are specific registers to be used for certain things.
ax = #
bx = #
cx = ax * bx

but I can't remember how to print...probably print cx would do it...


Jason

djdante97
05-07-2003, 06:47 PM
I think to print in assembly, you need to push all the appropriate values in the right order on the stack, and "call printf" or some other kernel supported output function.

BloodXero
05-09-2003, 04:50 PM
assembly doesnt use a "=" sign for assign variables, i believe it is this:

mov ax, #
mov bx, #
mov cx, (insert multiplaction thingy)

i dont know assembly enough even to know simple math in it but i know mov, push, and pop. and thats about it. my syntax is probably wrong in some way. check for assembly tutorials to find everything out for yourself.

Jason
05-09-2003, 11:11 PM
bloodxero is right....
mov ax #
mov bx #
mov cx (ax * bx)

pop cx //this is the print line

BloodXero
05-10-2003, 12:02 AM
http://www.xs4all.nl/~smit/asm01001.htm ... that should help.