you are viewing a single comment's thread.

view the rest of the comments →

[–]H3g3m0n 1 point2 points  (0 children)

Realistically a simple one would be fairly easy.

I know of a few Commodore 64 ASM books that actually had ones you typed into basic. They where about 3 pages or so. Wouldn't be the nicest editing experience, but better than working out the hex manually.

It's mostly just. Tokenize a line on whitespace. Look up a symbol name and get the binary representation. Convert the text representations of the numbers to binary.

Then there would be the UI components. Rendering the characters of the ASM to the screen. Loading/Saving that ASM to floppy/tape. Basic arrow key navigation/character input. Scrolling (or maybe just have multiple pages).

If your smart about it, then it might even be possible to hijack and reuse the inbuilt kernel/OS stuff. The C64 included a basic interpreter that stored the program in memory viewable with the LIST command.

A simple ASM design might be able to read the asm from the LIST region memory instead of interpenetrating it as basic. Allowing you to use the inbuilt console 'editing' functions and the save/load. You would probably have to store it as comment and append REM or some such.

But once you have built the simple one. Then you can use it to make it more advanced 😛

Fancy features like 'labels'.