Classic Computer Magazine Archive COMPUTE! ISSUE 47 / APRIL 1984 / PAGE 108

Machine Language To BASIC?

I would like to know if there is a program to translate a machine language program into BASIC. I realize that this sounds a bit impractical, but I think it would be a tremendous aid to us BASIC programmers who are trying to learn machine language.

It seems to me that if a BASIC Interpreter can translate BASIC instructions into machine language, that the opposite is equally possible. If it cannot be done, please explain why.

D. W. Bruce

The BASIC Interpreter doesn't actually translate BASIC into machine language. All the operations that can be performed from BASIC are permanently stored as machine language routines in Read Only Memory (ROM). The Interpreter first converts each BASIC keyword into a one-byte number called a token. Then, depending on the value of the token, certain of the per-manent machine language routines are executed in a predetermined order.

It is not possible to automatically translate machine language programs into BASIC equivalents. You could look at a machine language program and design a BASIC version of the same thing, but BASIC runs so much slower that it would serve no purpose other than being the educational exercise you mention.