Need Assembler help...

Thread Starter

justaslau

Joined Dec 9, 2012
1
Hello guys, I need your help with assembler. I'll have test on tuesday and I will have to convert assembler code to hex code... Do you know program which can convert ir for me ? i have an example:

stekas segment stack
db 8 dup ('aabb')
stekas ends
ds1 segment
d1 db 055h, 0ffh Answer: 0000 55 FF
d3 db 0cch, 33h, 55h, 2, 80h, 80h Answer: 0002 CC 33 55 02 80 80
d4 db 'abcde' Answer: 0008 61 62 63 64 65
d11 dw 7777h, 0505h, 13h, 34h, 0ffffh
ds1 ends
prr segment
assume ds:ds1, ss:stekas,cs:prr
pradzia: mov ax,ds1
mov ds,ax
mov ax,d11+1
and ax, 0ffffh
xor al,d1
mov cx,word ptr d4+1
neg cx
not ax
mov bx, d11+2
and d11+2,bx
or bx,ax
mov cl,d3+3
stc
rcl bx,cl
rol ax,cl
mov dx,d11+2
test dx,d11+3
shr dx,1
mov dx,word ptr d3+4
sal dx,1
sar dx,1
mov dh, 0cch
sar dx,1
shr dx,1
rcl ax,1
prr ends
end pradzia
 

spinnaker

Joined Oct 29, 2009
7,830
Any compiler will convert from assembler to hex. That is what they do. This post probably belongs in the programming forum.
 

t06afre

Joined May 11, 2009
5,934
This look like Intel Ix86 mnemonics to me so you will need some basic Ix86 assembler. I am somewhat puzzled that you ask a question like this. Then you are preparing for an exam. Have you been sleeping in class up to now ;)
 
definately Ix86 mnemonics. I am suprise any lecturer will test a student on memorising the mnemonics and translate that to hex. I speculate the lesson to be learnt here is to understand the operand and operator and how that translate into a intel hex file format.
 
Top