Aniq Makhani
Aniq Makhani

Reputation: 27

Conversion to Machine language

I am a student of Computer science, I have a course of COAL(Computer Organizing and assembly Language), I was trying to convert Assembly language into Machine language, but I am having some difficulties.

For example if I have to convert MOV [SI + 490], SP into Machine language, so how would I do it? I know some of the terms like d, w, mod, reg, r/m.

Some useful Link would be helpful. Thanks!

Upvotes: 1

Views: 959

Answers (1)

user555045
user555045

Reputation: 64933

First look up what kind of instruction it actually is, mov r/m16, r16 and it looks to be in 16bit mode so the format is 89 /r.

Then encode the ModR/M, the rm part is si + sword, the r is sp, so we get A4.

So in total:

89 A4 EA 01

Upvotes: 1

Related Questions